From 16678eb0f88512ac6a80bb89cfa50567ada56023 Mon Sep 17 00:00:00 2001 From: Marcin Kuzminski Date: Thu, 8 Oct 2020 14:10:11 +0200 Subject: [PATCH] reviewers: use common function to obtain reviewers with filter of role. --- rhodecode/model/comment.py | 2 +- rhodecode/model/pull_request.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/rhodecode/model/comment.py b/rhodecode/model/comment.py index d579880c..720a66a5 100644 --- 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 index 5633cc14..f6ab8d60 100644 --- 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]))