Skip to content

Commit 4b92370

Browse files
eviljeffKevinMind
authored andcommitted
reset file.status_disabled_reason when rejecting too (#22727)
1 parent f1015a7 commit 4b92370

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

src/olympia/reviewers/tests/test_utils.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3675,14 +3675,17 @@ def test_resolve_appeal_job(self):
36753675
def test_reject_multiple_versions_resets_original_status_too(self):
36763676
old_version = self.review_version
36773677
old_version.file.update(
3678-
status=amo.STATUS_DISABLED, original_status=amo.STATUS_APPROVED
3678+
status=amo.STATUS_DISABLED,
3679+
original_status=amo.STATUS_APPROVED,
3680+
status_disabled_reason=File.STATUS_DISABLED_REASONS.DEVELOPER,
36793681
)
36803682
self.review_version = version_factory(
36813683
addon=self.addon,
36823684
version='3.0',
36833685
file_kw={
36843686
'status': amo.STATUS_DISABLED,
36853687
'original_status': amo.STATUS_AWAITING_REVIEW,
3688+
'status_disabled_reason': File.STATUS_DISABLED_REASONS.DEVELOPER,
36863689
},
36873690
)
36883691
self.file = self.review_version.file
@@ -3698,6 +3701,10 @@ def test_reject_multiple_versions_resets_original_status_too(self):
36983701
assert self.review_version.file.reload().status == amo.STATUS_DISABLED
36993702
assert old_version.file.original_status == amo.STATUS_NULL
37003703
assert self.review_version.file.original_status == amo.STATUS_NULL
3704+
assert old_version.file.original_status == File.STATUS_DISABLED_REASONS.NONE
3705+
assert self.review_version.file.original_status == (
3706+
File.STATUS_DISABLED_REASONS.NONE
3707+
)
37013708

37023709

37033710
@override_settings(ENABLE_ADDON_SIGNING=True)

src/olympia/reviewers/utils.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
from olympia.addons.models import Addon, AddonApprovalsCounter, AddonReviewerFlags
2222
from olympia.constants.abuse import DECISION_ACTIONS
2323
from olympia.constants.promoted import RECOMMENDED
24+
from olympia.files.models import File
2425
from olympia.lib.crypto.signing import sign_file
2526
from olympia.reviewers.models import (
2627
AutoApprovalSummary,
@@ -867,6 +868,7 @@ def set_file(self, status, file):
867868
file.status = status
868869
if status == amo.STATUS_DISABLED:
869870
file.original_status = amo.STATUS_NULL
871+
file.status_disabled_reason = File.STATUS_DISABLED_REASONS.NONE
870872
file.save()
871873

872874
def set_promoted(self, versions=None):

0 commit comments

Comments
 (0)