Skip to content
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

Add ability to harden / soften blocks in the admin #22827

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

diox
Copy link
Member

@diox diox commented Nov 6, 2024

Fixes: mozilla/addons#15084

Description

See title, this allows admins to harden or soften a block (either partially or completely).

Context

Like with the rest of the block operations, you're never directly modifying Block or BlockVersion for this in the admin, instead you go through a BlocklistSubmission with a specific action. This allows signoff and makes the UI consistent across the various blocklist-related features in the admin.

Testing

There should be harden & soften buttons for a block. Once on the corresponding page, you should be able to select only the hard-blocked versions in that block for the soften action, and the opposite, soft-blocked versions for the harden action. Once you submit, the selected versions should have their block type changed according to the action performed.

The signoff mechanism is reused, untouched. So, if the change requires signoff (average daily users for the add-on is above configured threshold of settings.DUAL_SIGNOFF_AVERAGE_DAILY_USERS_THRESHOLD), the changes are pending approval, which is performed as normal in the same admin (in production it would be a different user, if DEBUG is True we allow the same user)

Checklist

  • Add #ISSUENUM at the top of your PR to an existing open issue in the mozilla/addons repository.
  • Successfully verified the change locally.
  • The change is covered by automated tests, or otherwise indicated why doing so is unnecessary/impossible.
  • Add before and after screenshots (Only for changes that impact the UI).
  • Add or update relevant docs reflecting the changes made.

@@ -658,6 +667,7 @@ def changeform_view(self, request, obj_id=None, form_url='', extra_context=None)
raise PermissionDenied
ModelForm = self.get_form(request, obj, change=bool(obj_id))
form = ModelForm(request.POST, request.FILES, instance=obj)
# FIXME: change action here depending on _soften/_harden ?
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Still need to decide the best way to do this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Task]: Implement soften and harden block actions in the admin
1 participant