Skip to content
Snippets Groups Projects
Unverified Commit d676771a authored by Sandeep Chauhan's avatar Sandeep Chauhan Committed by GitHub
Browse files

Add slack notification for reviewers on review submit by the role reviewers (#3433)

Fixes #3421
parent 3c2d15c9
No related branches found
No related tags found
2 merge requests!23Add ReviewOpinion delete functionality to review sidebar (#3565),!20Merge in v4.7.0 and v4.8.0
......@@ -174,16 +174,13 @@ class SlackAdapter(AdapterBase):
recipients = [self.slack_id(source.lead)]
# Notify second reviewer when first reviewer is done.
if message_type == MESSAGES.NEW_REVIEW and related:
if message_type in [MESSAGES.NEW_REVIEW, MESSAGES.REVIEW_OPINION] and related:
submission = source
if (
submission.assigned.with_roles().count() == 2
and related.author.reviewer
== submission.assigned.with_roles().first().reviewer
):
recipients.append(
self.slack_id(submission.assigned.with_roles().last().reviewer)
)
role_reviewers = [role_reviewer.reviewer for role_reviewer in submission.assigned.with_roles()]
if related.author.reviewer in role_reviewers:
for reviewer in role_reviewers:
if reviewer != related.author.reviewer:
recipients.append(self.slack_id(reviewer))
if message_type == MESSAGES.UPDATE_INVOICE_STATUS:
if related.status in [
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment