Allow adding, viewing information about and deleting soft-blocks in the admin #22765
+316
−64
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fixes mozilla/addons#15013
Description
Like other blocklist operations, everything goes through a
BlocklistSubmission
, which gains a newblock_type
field to determine what kind of block to apply for this particular submission. Users are not allowed to modifyBlock
s directly.Note: If a version is already soft-blocked or hard-blocked, that version won't be selectable when creating a new
BlocklistSubmission
, even of another type. However, the code underneath should handle overriding the block type for a given blocked version in a submission, and future actions will be added to soften or harden blocks.Testing
Play around with the admin and add/delete
BlocklistSubmission
, and then inspect the blocks until you're satisfied. Few things you can try to mix together:BlocklistSubmission
for add-ons withaverage_daily_users
abovesettings.DUAL_SIGNOFF_AVERAGE_DAILY_USERS_THRESHOLD
are subject to approval as before. You can check that it still behaves as expected. You shouldn't be able to modify a block type for a submission you're approving (arbitrary decision on my part, we could change this later)