summaryrefslogtreecommitdiff
path: root/django
diff options
context:
space:
mode:
authorJulien Phalip <jphalip@gmail.com>2012-07-21 18:10:24 -0700
committerJulien Phalip <jphalip@gmail.com>2012-07-21 18:10:24 -0700
commit01c392623d988d7486bdaa870886df0ea3da5fa7 (patch)
tree2d7f3814ad2d3e2cf2640806c658efab163586b2 /django
parentea667ee3aeed33bce1dd681d9c0ea42f9926db5a (diff)
Fixed #10057 -- Ensured that the 'show_delete' context variable in the admin's change view actually controls the display of the delete button. Thanks to rajeesh for the report, to patcoll for the patch, and to David Gouldin for the test.
Diffstat (limited to 'django')
-rw-r--r--django/contrib/admin/options.py1
-rw-r--r--django/contrib/admin/templatetags/admin_modify.py2
2 files changed, 1 insertions, 2 deletions
diff --git a/django/contrib/admin/options.py b/django/contrib/admin/options.py
index 4d23f8f384..40f6e2842c 100644
--- a/django/contrib/admin/options.py
+++ b/django/contrib/admin/options.py
@@ -998,7 +998,6 @@ class ModelAdmin(BaseModelAdmin):
'title': _('Add %s') % force_unicode(opts.verbose_name),
'adminform': adminForm,
'is_popup': "_popup" in request.REQUEST,
- 'show_delete': False,
'media': media,
'inline_admin_formsets': inline_admin_formsets,
'errors': helpers.AdminErrorList(form, formsets),
diff --git a/django/contrib/admin/templatetags/admin_modify.py b/django/contrib/admin/templatetags/admin_modify.py
index e55b3bf2bd..c190533f95 100644
--- a/django/contrib/admin/templatetags/admin_modify.py
+++ b/django/contrib/admin/templatetags/admin_modify.py
@@ -32,7 +32,7 @@ def submit_row(context):
'onclick_attrib': (opts.get_ordered_objects() and change
and 'onclick="submitOrderForm();"' or ''),
'show_delete_link': (not is_popup and context['has_delete_permission']
- and (change or context['show_delete'])),
+ and change and context.get('show_delete', True)),
'show_save_as_new': not is_popup and change and save_as,
'show_save_and_add_another': context['has_add_permission'] and
not is_popup and (not save_as or context['add']),