Skip to content

Commit 433a1c8

Browse files
committed
Allow automated disable&block action to be appealed (and handle such appeals) (#23832)
1 parent 31716b2 commit 433a1c8

File tree

3 files changed

+15
-2
lines changed

3 files changed

+15
-2
lines changed

src/olympia/abuse/actions.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -801,8 +801,13 @@ def process_action(self, release_hold=False):
801801
.order_by('-pk')
802802
)
803803
if self.previous_decisions.filter(
804-
action=DECISION_ACTIONS.AMO_DISABLE_ADDON
804+
action__in=(
805+
DECISION_ACTIONS.AMO_DISABLE_ADDON,
806+
DECISION_ACTIONS.AMO_BLOCK_ADDON,
807+
)
805808
).exists():
809+
# FIXME: we should also automatically revert the block if the
810+
# previous decision was AMO_BLOCK_ADDON.
806811
target_versions = list(target_versions)
807812
if target.status == amo.STATUS_DISABLED:
808813
target.force_enable(skip_activity_log=True)

src/olympia/abuse/tests/test_actions.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1783,14 +1783,18 @@ def test_notify_stakeholders_with_policy_texts(self):
17831783

17841784
class TestContentActionBlockAddon(TestContentActionDisableAddon):
17851785
ActionClass = ContentActionBlockAddon
1786-
takedown_decision_action = DECISION_ACTIONS.AMO_DISABLE_ADDON
1786+
takedown_decision_action = DECISION_ACTIONS.AMO_BLOCK_ADDON
17871787

17881788
def setUp(self):
17891789
super().setUp()
17901790
self.decision.update(
17911791
reviewer_user=self.task_user,
17921792
metadata={ContentDecision.POLICY_DYNAMIC_VALUES: {}},
17931793
)
1794+
self.past_negative_decision.update(
1795+
reviewer_user=self.task_user,
1796+
metadata={ContentDecision.POLICY_DYNAMIC_VALUES: {}},
1797+
)
17941798
block = Block.objects.create(addon=self.addon, updated_by=self.task_user)
17951799
BlockVersion.objects.create(block=block, version=self.another_version)
17961800

src/olympia/constants/abuse.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,10 @@
3737
'AMO_DELETE_RATING',
3838
'AMO_DELETE_COLLECTION',
3939
'AMO_REJECT_VERSION_ADDON',
40+
# Note: AMO_BLOCK_ADDON is appealable, but at the moment the blocking
41+
# part can't be automatically reverted by a successful appeal and has
42+
# to be done manually.
43+
'AMO_BLOCK_ADDON',
4044
),
4145
)
4246
DECISION_ACTIONS.add_subset(

0 commit comments

Comments
 (0)