# HG changeset patch # User Marcin Kuzminski # Date 2020-06-12 20:14:48 # Node ID cf2c34da79553d88c285508871637c45b069d57d # Parent 1971c1867d9fa30661e814dce7a60df0ee3827c9 default-reviewers: fixed problems with new diff format for more advanced default reviewer rules. diff --git a/rhodecode/model/db.py b/rhodecode/model/db.py --- a/rhodecode/model/db.py +++ b/rhodecode/model/db.py @@ -4962,7 +4962,9 @@ class RepoReviewRule(Base, BaseModel): else: file_pattern = glob2re(self.file_pattern) file_regex = re.compile(file_pattern) - for filename in files_changed: + for file_data in files_changed: + filename = file_data.get('filename') + if file_regex.search(filename): files_matches = True break diff --git a/rhodecode/model/pull_request.py b/rhodecode/model/pull_request.py --- a/rhodecode/model/pull_request.py +++ b/rhodecode/model/pull_request.py @@ -186,7 +186,7 @@ def get_diff_info( email = commit.author_email user = User.get_from_cs_author(author) if user: - user_counts[user] = user_counts.get(user, 0) + 1 + user_counts[user.user_id] = user_counts.get(user.user_id, 0) + 1 author_counts[author] = author_counts.get(author, 0) + 1 email_counts[email] = email_counts.get(email, 0) + 1