Opened 15 years ago

Closed 14 years ago

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

Download all attachments as: .zip

Change History (10)

comment:1 by Ben Davis, 15 years ago

Owner: changed from nobody to Ben Davis
Status: newassigned

comment:2 by Ben Davis, 15 years ago

Triage Stage: UnreviewedAccepted

comment:3 by Ben Davis, 14 years ago

Triage Stage: AcceptedUnreviewed

comment:4 by Russell Keith-Magee, 14 years ago

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.

by Ramiro Morales, 14 years ago

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

Patch by bendavis78 updated to r12889 plus a documentation blurb addition

comment:5 by Ramiro Morales, 14 years ago

Patch needs improvement: unset

comment:6 by Russell Keith-Magee, 14 years ago

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 by Russell Keith-Magee, 14 years ago

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

milestone: 1.2

Milestone 1.2 deleted

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