# HG changeset patch # User Marcin Kuzminski # Date 2020-10-08 12:10:11 # Node ID 966516132fb0c76d8ebea32be204ed6e9457a9b2 # Parent 8c4f7e94db13fa3791886b286c82f67f394613b4 reviewers: use common function to obtain reviewers with filter of role. diff --git a/rhodecode/model/comment.py b/rhodecode/model/comment.py --- a/rhodecode/model/comment.py +++ b/rhodecode/model/comment.py @@ -399,7 +399,7 @@ class CommentsModel(BaseModel): recipients += [pull_request_obj.author] # add the reviewers to notification - recipients += [x.user for x in pull_request_obj.reviewers] + recipients += [x.user for x in pull_request_obj.get_pull_request_reviewers()] pr_target_repo = pull_request_obj.target_repo pr_source_repo = pull_request_obj.source_repo 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 @@ -1526,7 +1526,7 @@ class PullRequestModel(BaseModel): commit_changes, file_changes): updating_user_id = updating_user.user_id - reviewers = set([x.user.user_id for x in pull_request.reviewers]) + reviewers = set([x.user.user_id for x in pull_request.get_pull_request_reviewers()]) # NOTE(marcink): send notification to all other users except to # person who updated the PR recipients = reviewers.difference(set([updating_user_id]))