reviewers: use common function to obtain reviewers with filter of role.

This commit is contained in:
Marcin Kuzminski 2020-10-08 14:10:11 +02:00
parent 0bbae6c416
commit 16678eb0f8
2 changed files with 2 additions and 2 deletions

View file

@ -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

View file

@ -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]))