Code

Opened 5 years ago

Closed 4 years ago

Last modified 3 years ago

#11949 closed (fixed)

delete_selected action incorrectly uses AdminSite.delete_confirmation_template

Reported by: bendavis78 Owned by: bendavis78
Component: contrib.admin Version: 1.1
Severity: Keywords: delete selected override template
Cc: Triage Stage: Accepted
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: UI/UX:

Description

I believe this was just an oversight on the original developer's part. In django.contrib.admin.actions, in delete_selected, it was using AdminSite.delete_confirmation_template, which is actually not the right template. If someone was to override AdminSite.delete_confirmation_template, the delete_selected action would no longer work.

I've attached a simple patch that fixes this problem, and adds support for overriding delete_selected_confirmation_template.

Attachments (2)

delete-selected-confirmation-template-override.diff (2.1 KB) - added by bendavis78 5 years ago.
11949-r12889-with-docs.diff (2.5 KB) - added by ramiro 4 years ago.
Patch by bendavis78 updated to r12889 plus a documentation blurb addition

Download all attachments as: .zip

Change History (10)

comment:1 Changed 5 years ago by bendavis78

  • Needs documentation unset
  • Needs tests unset
  • Owner changed from nobody to bendavis78
  • Patch needs improvement unset
  • Status changed from new to assigned

comment:2 Changed 5 years ago by bendavis78

  • Triage Stage changed from Unreviewed to Accepted

comment:3 Changed 4 years ago by bendavis78

  • Triage Stage changed from Accepted to Unreviewed

comment:4 Changed 4 years ago by russellm

  • milestone set to 1.2
  • Patch needs improvement set
  • Triage Stage changed from Unreviewed to Accepted

Pushing into 1.2 because of the potential for displaying the wrong list of deleted objects. Marking 'needs improvement' because this patch should be checked against the recent changes for #6191. There might not actually be a problem, but it warrants closer inspection.

Changed 4 years ago by ramiro

Patch by bendavis78 updated to r12889 plus a documentation blurb addition

comment:5 Changed 4 years ago by ramiro

  • Patch needs improvement unset

comment:6 Changed 4 years ago by russellm

  • Resolution set to fixed
  • Status changed from assigned to closed

(In [12916]) Fixed #11949 -- Added a hook to allow ModelAdmin customization of the delete selected template. Thanks to bendavis78 for the report and patch, and Ramiro Morales for his cleanup work.

comment:7 Changed 4 years ago by russellm

(In [12917]) [1.1.X] Fixed #11949 -- Added a hook to allow ModelAdmin customization of the delete selected template. Thanks to bendavis78 for the report and patch, and Ramiro Morales for his cleanup work.

Backport of r12916 from trunk.

comment:8 Changed 3 years ago by jacob

  • milestone 1.2 deleted

Milestone 1.2 deleted

Add Comment

Modify Ticket

Change Properties
<Author field>
Action
as closed
as The resolution will be set. Next status will be 'closed'
The resolution will be deleted. Next status will be 'new'
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.