Skip to content

Email not sent to reviewers when processing to External Review status #4692

@frankduncan

Description

@frankduncan

Describe the bug

When in an external review workflow, no email is sent when transitioning to external review.

To Reproduce

Steps to reproduce the behavior:

  1. Create a request with external review submission
  2. Assign a reviewer
  3. Progress the submission to External Review
  4. See that no email is sent to reviewers
  5. Progress the submission to Close Review
  6. See an email sent to reviewers

Expected behavior

An email is sent when transitioning to the External Review step
Affected roles

  • Reviewers

Additional context

It is most like related to this change setting instance to the state before the transition happens, which causes the messaging pipeline to not fire off since it only finds reviewers: 60ce996

See the line @status_field.on_success(). That fires before the instance is saved, and so all the messaging framework is working with a submission before it's actually been updated. Of note in the messaging framework, in email.py, in def reviewers, there's source.phase.permissions.can_review(reviewer) which will fail if the submission is not currently in a review phase. Interestingly enough, this is why the email gets fired when the submission moves OUT of the review phase (either reverting, or moving forward)

This may be the cause of #4678.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type: BugBugs! Things that are broken :-/

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions