Skip to content

send owner email for override of takedown -> ignore #22944

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Dec 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions src/olympia/abuse/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -1091,7 +1091,7 @@ def get_action_helper(self, *, overridden_action=None, appealed_action=None):
if appealed_action:
# target appeal
if appealed_action in DECISION_ACTIONS.REMOVING:
if self.action in DECISION_ACTIONS.APPROVING:
if self.action in DECISION_ACTIONS.NON_OFFENDING:
# i.e. we've reversed our target takedown
ContentActionClass = ContentActionTargetAppealApprove
elif self.action == appealed_action:
Expand All @@ -1101,7 +1101,7 @@ def get_action_helper(self, *, overridden_action=None, appealed_action=None):

elif overridden_action in DECISION_ACTIONS.REMOVING:
# override on a decision that was a takedown before, and wasn't an appeal
if self.action in DECISION_ACTIONS.APPROVING:
if self.action in DECISION_ACTIONS.NON_OFFENDING:
ContentActionClass = ContentActionOverrideApprove
if self.action == overridden_action:
# For an override that is still a takedown we can send the same emails
Expand Down Expand Up @@ -1299,7 +1299,7 @@ def notify_reviewer_decision(
'version__version', flat=True
)
is_auto_approval = (
self.action in DECISION_ACTIONS.APPROVING
self.action == DECISION_ACTIONS.AMO_APPROVE_VERSION
and not log_entry.details.get('human_review', True)
)
action_helper.notify_owners(
Expand Down
6 changes: 5 additions & 1 deletion src/olympia/abuse/tests/test_models.py
Original file line number Diff line number Diff line change
Expand Up @@ -1914,7 +1914,7 @@ def test_reporter_cant_appeal_non_approve_decision(self):
for decision_action in (
action
for action, _ in DECISION_ACTIONS
if action not in DECISION_ACTIONS.APPROVING
if action not in DECISION_ACTIONS.APPEALABLE_BY_REPORTER
):
self.decision.update(
action=decision_action,
Expand Down Expand Up @@ -2403,6 +2403,10 @@ def test_get_action_helper(self):
action_existing_to_class[
(DECISION_ACTIONS.AMO_APPROVE_VERSION, action, None)
] = ContentActionOverrideApprove
# and override from takedown to ignore
action_existing_to_class[(DECISION_ACTIONS.AMO_IGNORE, action, None)] = (
ContentActionOverrideApprove
)

for (
new_action,
Expand Down
4 changes: 3 additions & 1 deletion src/olympia/constants/abuse.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,9 @@
'AMO_REJECT_VERSION_ADDON',
),
)
DECISION_ACTIONS.add_subset('APPROVING', ('AMO_APPROVE', 'AMO_APPROVE_VERSION'))
DECISION_ACTIONS.add_subset(
'NON_OFFENDING', ('AMO_APPROVE', 'AMO_APPROVE_VERSION', 'AMO_IGNORE')
)
DECISION_ACTIONS.add_subset(
'SKIP_DECISION', ('AMO_APPROVE', 'AMO_APPROVE_VERSION', 'AMO_LEGAL_FORWARD')
)
Expand Down
Loading