addons-server
addons-server copied to clipboard
Log when an admin deletes/undeletes a collection through the admin
Also avoid showing deleted field if the collection isn't already deleted - that's pointless and confusing, admins should use the regular delete action if they want to delete something.
Fixes https://github.com/mozilla/addons/issues/15394
Testing
- As an admin (needs
Collections:Editpermission + access to the admin, or just*:*) look at a non-deleted collection detail page in the admin -
Deletedfield should be absent - Delete that collection through the button
- Collection should now be deleted - can't see it in frontend
- An
ActivityLogwithCOLLECTION_DELETEDaction and the collection as argument should have been recorded in the database - Go back to that collection admin detail page
-
Slugfield should not have changed (it would if the user would have deleted the collection themselves through the frontend) -
Deletedfield should be present and ticked - Untick
Deletedfield and hit save - An
ActivityLogwithCOLLECTION_UNDELETEDaction and the collection as argument should have been recorded in the database - Collection should now be undeleted - can see it in frontend