summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRedouane Zait <unrealdz@gmail.com>2014-11-23 15:08:34 +0100
committerTim Graham <timograham@gmail.com>2014-11-25 11:22:15 -0500
commit8e7b384d89db67e450aef1f2eb9a12703a5942e9 (patch)
tree3829f790ab2d7b8892d61c1bfc59d316373007ee
parent392e11945fa246d751d23bb515703fcaf55dfa26 (diff)
Fixed #23898 -- Added missing context to admin's deleted_selected view.
Thanks Redouane Zait for the report.
-rw-r--r--django/contrib/admin/actions.py23
-rw-r--r--docs/releases/1.7.2.txt3
-rw-r--r--tests/admin_views/tests.py1
3 files changed, 16 insertions, 11 deletions
diff --git a/django/contrib/admin/actions.py b/django/contrib/admin/actions.py
index 3a841bb6c8..7374d9cea8 100644
--- a/django/contrib/admin/actions.py
+++ b/django/contrib/admin/actions.py
@@ -63,17 +63,18 @@ def delete_selected(modeladmin, request, queryset):
else:
title = _("Are you sure?")
- context = {
- "title": title,
- "objects_name": objects_name,
- "deletable_objects": [deletable_objects],
- "model_count": dict(model_count),
- 'queryset': queryset,
- "perms_lacking": perms_needed,
- "protected": protected,
- "opts": opts,
- 'action_checkbox_name': helpers.ACTION_CHECKBOX_NAME,
- }
+ context = dict(
+ modeladmin.admin_site.each_context(),
+ title=title,
+ objects_name=objects_name,
+ deletable_objects=[deletable_objects],
+ model_count=dict(model_count),
+ queryset=queryset,
+ perms_lacking=perms_needed,
+ protected=protected,
+ opts=opts,
+ action_checkbox_name=helpers.ACTION_CHECKBOX_NAME,
+ )
# Display the confirmation page
return TemplateResponse(request, modeladmin.delete_selected_confirmation_template or [
diff --git a/docs/releases/1.7.2.txt b/docs/releases/1.7.2.txt
index 62419be63e..1465db5def 100644
--- a/docs/releases/1.7.2.txt
+++ b/docs/releases/1.7.2.txt
@@ -80,3 +80,6 @@ Bugfixes
* Fixed ``django.core.files.File.__repr__()`` when the file's ``name`` contains
Unicode characters (:ticket:`23888`).
+
+* Added missing context to the admin's ``delete_selected`` view that prevented
+ custom site header, etc. from appearing (:ticket:`23898`).
diff --git a/tests/admin_views/tests.py b/tests/admin_views/tests.py
index d8758cd3ac..3d1c5eb7c8 100644
--- a/tests/admin_views/tests.py
+++ b/tests/admin_views/tests.py
@@ -838,6 +838,7 @@ class AdminCustomTemplateTests(AdminViewBasicTestCase):
'_selected_action': group.id
}
response = self.client.post('/test_admin/%s/auth/group/' % (self.urlbit), post_data)
+ self.assertEqual(response.context['site_header'], 'Django administration')
self.assertContains(response, 'bodyclass_consistency_check ')
def test_filter_with_custom_template(self):