Skip to content

Commit

Permalink
Allow reviewers to reply to blocked versions (#22952)
Browse files Browse the repository at this point in the history
  • Loading branch information
diox authored Dec 17, 2024
1 parent 7f52824 commit 6dd4a74
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 12 deletions.
8 changes: 4 additions & 4 deletions src/olympia/reviewers/forms.py
Original file line number Diff line number Diff line change
Expand Up @@ -167,13 +167,13 @@ def create_option(self, *args, **kwargs):
status = obj.file.status if obj.file else None
# We annotate that needs_human_review property in review().
needs_human_review = getattr(obj, 'needs_human_review', False)
if status == amo.STATUS_DISABLED and obj.is_blocked:
# Override status for blocked versions: we don't want them
# unrejected.
status = None
# Add our special `data-toggle` class and the right `data-value`
# depending on what state the version is in.
actions = self.actions_filters[obj.channel].get(status, []).copy()
if status == amo.STATUS_DISABLED and obj.is_blocked:
# We don't want blocked versions to get unrejected. Reply is
# fine though.
actions.remove('unreject_multiple_versions')
if obj.pending_rejection:
actions.append('clear_pending_rejection_multiple_versions')
if needs_human_review:
Expand Down
16 changes: 8 additions & 8 deletions src/olympia/reviewers/tests/test_forms.py
Original file line number Diff line number Diff line change
Expand Up @@ -742,10 +742,10 @@ def test_versions_queryset_contains_pending_files_for_listed(

option4 = doc('option[value="%s"]' % blocked_version.pk)[0]
assert option4.attrib.get('class') == 'data-toggle'
# That version is blocked, so unreject_multiple_versions is not
# present. It was never signed, so
# set_needs_human_review_multiple_versions is also absent.
assert option4.attrib.get('data-value') == ''
# That version is blocked, so the only action available is reply,
# unreject_multiple_versions and
# set_needs_human_review_multiple_versions should be absent.
assert option4.attrib.get('data-value') == 'reply'
assert option4.attrib.get('value') == str(blocked_version.pk)

def test_versions_queryset_contains_pending_files_for_listed_admin_reviewer(self):
Expand Down Expand Up @@ -867,10 +867,10 @@ def test_versions_queryset_contains_pending_files_for_unlisted(

option4 = doc('option[value="%s"]' % blocked_version.pk)[0]
assert option4.attrib.get('class') == 'data-toggle'
# That version is blocked, so unreject_multiple_versions is not
# present. It was never signed, so
# set_needs_human_review_multiple_versions is also absent.
assert option4.attrib.get('data-value') == ''
# That version is blocked, so the only action available is reply,
# unreject_multiple_versions and
# set_needs_human_review_multiple_versions should be absent.
assert option4.attrib.get('data-value') == 'reply'
assert option4.attrib.get('value') == str(blocked_version.pk)

def test_set_needs_human_review_presence(self):
Expand Down

0 comments on commit 6dd4a74

Please sign in to comment.