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
This commit is part of merge request !23. Comments created here will be created in the context of that merge request.
...@@ -174,16 +174,13 @@ class SlackAdapter(AdapterBase): ...@@ -174,16 +174,13 @@ class SlackAdapter(AdapterBase):
recipients = [self.slack_id(source.lead)] recipients = [self.slack_id(source.lead)]
# Notify second reviewer when first reviewer is done. # 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 submission = source
if ( role_reviewers = [role_reviewer.reviewer for role_reviewer in submission.assigned.with_roles()]
submission.assigned.with_roles().count() == 2 if related.author.reviewer in role_reviewers:
and related.author.reviewer for reviewer in role_reviewers:
== submission.assigned.with_roles().first().reviewer if reviewer != related.author.reviewer:
): recipients.append(self.slack_id(reviewer))
recipients.append(
self.slack_id(submission.assigned.with_roles().last().reviewer)
)
if message_type == MESSAGES.UPDATE_INVOICE_STATUS: if message_type == MESSAGES.UPDATE_INVOICE_STATUS:
if related.status in [ 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