Skip to content

Commit

Permalink
make moderator digest respect resubmission in it's message
Browse files Browse the repository at this point in the history
  • Loading branch information
John Tordoff committed Aug 21, 2024
1 parent def2089 commit 6822ad9
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 5 deletions.
1 change: 1 addition & 0 deletions osf/utils/notifications.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ def notify_submit(resource, user, *args, **kwargs):
def notify_resubmit(resource, user, *args, **kwargs):
context = get_email_template_context(resource)
context['referrer'] = user
context['resubmission'] = True
recipients = list(resource.contributors)
reviews_signals.reviews_email_submit.send(
recipients=recipients,
Expand Down
5 changes: 4 additions & 1 deletion website/reviews/listeners.py
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,10 @@ def reviews_submit_notification_moderators(self, timestamp, context):
context['message'] = f'submitted updates to "{resource.title}".'
context['reviews_submission_url'] += f'&revisionId={revision_id}'
else:
context['message'] = f'submitted "{resource.title}".'
if context.get('resubmission'):
context['message'] = f'resubmitted "{resource.title}".'
else:
context['message'] = f'submitted "{resource.title}".'

# Get NotificationSubscription instance, which contains reference to all subscribers
provider_subscription, created = NotificationSubscription.objects.get_or_create(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,17 @@
<%def name="content()">
<div style="margin: 40px;">
<p>
Hello ${recipient.fullname},
Hello ${referrer.fullname},
</p>
<p>
The ${document_type} <a href="${reviewable.absolute_url}">${reviewable.title}</a> has been successfully
re-submitted to ${reviewable.provider.name}.
resubmitted to ${reviewable.provider.name}.
</p>
<p>
${reviewable.provider.name} has chosen to moderate their submissions using a pre-moderation workflow, which
means your submission is pending until accepted by a moderator.
% if not no_future_emails: You will receive
a separate notification informing you of any status changes.
% if not no_future_emails:
You will receive a separate notification informing you of any status changes.
% endif
</p>
<p>
Expand Down

0 comments on commit 6822ad9

Please sign in to comment.