Opened 10 years ago

Closed 10 years ago

Last modified 8 years ago

#11949 closed (fixed)

delete_selected action incorrectly uses AdminSite.delete_confirmation_template

Reported by: Ben Davis Owned by: Ben Davis
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: no UI/UX: no

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 Ben Davis 10 years ago.
11949-r12889-with-docs.diff (2.5 KB) - added by Ramiro Morales 10 years ago.
Patch by bendavis78 updated to r12889 plus a documentation blurb addition

Download all attachments as: .zip

Change History (10)

comment:1 Changed 10 years ago by Ben Davis

Owner: changed from nobody to Ben Davis
Status: newassigned

comment:2 Changed 10 years ago by Ben Davis

Triage Stage: UnreviewedAccepted

comment:3 Changed 10 years ago by Ben Davis

Triage Stage: AcceptedUnreviewed

comment:4 Changed 10 years ago by Russell Keith-Magee

milestone: 1.2
Patch needs improvement: set
Triage Stage: UnreviewedAccepted

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 10 years ago by Ramiro Morales

Attachment: 11949-r12889-with-docs.diff added

Patch by bendavis78 updated to r12889 plus a documentation blurb addition

comment:5 Changed 10 years ago by Ramiro Morales

Patch needs improvement: unset

comment:6 Changed 10 years ago by Russell Keith-Magee

Resolution: fixed
Status: assignedclosed

(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 10 years ago by Russell Keith-Magee

(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 8 years ago by Jacob

milestone: 1.2

Milestone 1.2 deleted

Note: See TracTickets for help on using tickets.
Back to Top