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

Gh-858: make sure we handle batch transition in kwargs

parent 0c1595c8
No related branches found
No related tags found
No related merge requests found
...@@ -200,11 +200,14 @@ class ActivityAdapter(AdapterBase): ...@@ -200,11 +200,14 @@ class ActivityAdapter(AdapterBase):
def recipients(self, message_type, **kwargs): def recipients(self, message_type, **kwargs):
return [None] return [None]
def extra_kwargs(self, message_type, submission, **kwargs): def extra_kwargs(self, message_type, submission, submissions, **kwargs):
from .models import INTERNAL from .models import INTERNAL
if message_type in [MESSAGES.OPENED_SEALED, MESSAGES.REVIEWERS_UPDATED, MESSAGES.SCREENING]: if message_type in [MESSAGES.OPENED_SEALED, MESSAGES.REVIEWERS_UPDATED, MESSAGES.SCREENING]:
return {'visibility': INTERNAL} return {'visibility': INTERNAL}
if message_type == MESSAGES.TRANSITION and not submission.phase.permissions.can_view(submission.user): is_transition = message_type in [MESSAGES.TRANSITION, MESSAGES.BATCH_TRANSITION]
submission = submission or submissions[0]
if is_transition and not submission.phase.permissions.can_view(submission.user):
# User's shouldn't see status activity changes for stages that aren't visible to the them # User's shouldn't see status activity changes for stages that aren't visible to the them
return {'visibility': INTERNAL} return {'visibility': INTERNAL}
return {} return {}
......
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