Skip to content
Snippets Groups Projects
Commit 3f12bbc8 authored by Todd Dembrey's avatar Todd Dembrey
Browse files

Add new review messages

parent b19b8407
No related branches found
No related tags found
No related merge requests found
......@@ -12,6 +12,7 @@ class MESSAGES(Enum):
DETERMINATION_OUTCOME = 'determination_outcome'
INVITED_TO_PROPOSAL = 'invited_to_proposal'
REVIEWERS_UPDATED = 'reviewers_updated'
NEW_REVIEW = 'new_review'
COMMENT = 'comment'
......@@ -29,6 +30,7 @@ class ActivityAdapter:
MESSAGES.DETERMINATION_OUTCOME: 'Sent a {submission.determination.get_outcome_display} determination for {submission.title}:\r\n{determination.clean_message}',
MESSAGES.INVITED_TO_PROPOSAL: '{submission.title} has been invited to submit a proposal.',
MESSAGES.REVIEWERS_UPDATED: 'reviewers_updated',
MESSAGES.NEW_REVIEW: 'Created a review for {submission.title}'
}
def message(self, message_type, **kwargs):
......
......@@ -5,9 +5,10 @@ from django.db.models.signals import post_save
from django.dispatch import receiver
from django.urls import reverse
from opentech.apply.activity.models import Activity
from opentech.apply.activity.messaging import messenger, MESSAGES
from opentech.apply.users.models import User
NO = 0
MAYBE = 1
YES = 2
......@@ -92,8 +93,8 @@ def update_submission_reviewers_list(sender, **kwargs):
review.submission.reviewers.add(review.author)
if kwargs.get('created', False):
Activity.actions.create(
messenger(
MESSAGES.NEW_REVIEW,
user=review.author,
submission=review.submission,
message=f'Created a review for {review.submission.title}'
)
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