addons icon indicating copy to clipboard operation
addons copied to clipboard

[Task]: Add logging in django admin when deleting collections

Open diox opened this issue 9 months ago • 2 comments

Description

When an admin deletes a collection through the django admin, we should emit a COLLECTION_DELETED activity log like we do when it comes from Cinder.

Ideally, we should even use the same ContentActionDeleteCollection code, which handles holding off the action for 2nd approval, offering possibility of appeal to the author, etc, but because the action is not coming from Cinder that could be more involved and might need to be split into a different ticket.

Acceptance Criteria

  ### Milestones/checkpoints
  - [ ] Collections deleted through the admin emit `COLLECTION_DELETED` activity log 

Checks

  • [x] If I have identified that the work is specific to a repository, I have removed "repository:addons-server" or "repository:addons-frontend"

┆Issue is synchronized with this Jira Task

diox avatar Feb 24 '25 11:02 diox

using ContentActionDeleteCollection would need us to start on https://mozilla-hub.atlassian.net/browse/AOP-460 - the major pieces of work are:

  • the ability to select a policy and/or notes to justify the takedown when the decision to deletion the collection is taken
  • a way to be aware of, and process, any appeals to those decisions

eviljeff avatar Feb 24 '25 11:02 eviljeff

https://github.com/mozilla/addons/issues/15407 was filed for the work related to using ContentActionDeleteCollection , we can focus on just emitting the activity log in the meantime so that we have proper records.

diox avatar Mar 25 '25 11:03 diox

@diox

I tested the str on dev and looks good.

I thought of trying to take down a collection from Cinder and noticed that atm that's not working on dev or stage , for collections, ratings or extensions.

STR would be:

  • sending the report to Cinder
  • choosing a policy that disables content

But none of the attempts were successful, I've no emails sent either. (marking this verified since it's unrelated)

ioanarusiczki avatar Apr 08 '25 07:04 ioanarusiczki

Just to add , I've been testing this on -stage last week before the push and it was working as expected.

AMO addon and the job in Cinder

ioanarusiczki avatar Apr 08 '25 08:04 ioanarusiczki