Add Content rejected state to possible add-on statuses; and ContentActionRejectListingContent #24308
+554
−60
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#15985 and also fixes mozilla/addons#15983
Description
Minimally implements the concept of a listing rejection, and adds a ContentAction - that would be assigned to appropriate policies - that sets it, and reverts it on appeal.
Context
An initial outstanding content review wouldn't affect the add-on status, because it's silent (and could occur under any add-on status), but once the content is rejected, STATUS_REJECTED means the add-on isn't public, and the status becomes sticky (developers can't get around it by deleting versions, etc). Only an appeal (supported), or a new content review that has an approve decision (not implemented yet), can reverse the rejection and move the add-on back to an appropriate status (be it approved, nominated, or otherwise).
I initially implemented this entirely with STATUS_REJECTED, but if we want add-on disables, and the reverse, to still work there needs to be a flag that indicates the add-on has a failed content review so the status can be recovered. It seemed like AddonApprovalsCounter was a good enough place as it was already tracking dates for successful content review... but now's the time to suggest a better location for the field.
Testing
amo-disable-addontoamo-reject-listing-contentin both places in the json./manage.py fake_cinder_webhookChecklist
#ISSUENUMat the top of your PR to an existing open issue in the mozilla/addons repository.