From 39fec03db68ed174ebf26c95a9f891cd86d34b36 Mon Sep 17 00:00:00 2001 From: Adrian Holovaty Date: Sat, 21 Jan 2006 04:01:00 +0000 Subject: [PATCH] magic-removal: Simplified code in admin.templatetags.admin_modify.submit_row git-svn-id: http://code.djangoproject.com/svn/django/branches/magic-removal@2081 bcc190cf-cafb-0310-a4f2-bffc1f526a37 --- django/contrib/admin/templatetags/admin_modify.py | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/django/contrib/admin/templatetags/admin_modify.py b/django/contrib/admin/templatetags/admin_modify.py index a45ced1a44..874bee46e7 100644 --- a/django/contrib/admin/templatetags/admin_modify.py +++ b/django/contrib/admin/templatetags/admin_modify.py @@ -24,17 +24,14 @@ include_admin_script = register.simple_tag(include_admin_script) def submit_row(context, bound_manipulator): change = context['change'] - add = context['add'] - show_delete = context['show_delete'] - has_delete_permission = context['has_delete_permission'] is_popup = context['is_popup'] return { 'onclick_attrib': (bound_manipulator.ordered_objects and change and 'onclick="submitOrderForm();"' or ''), - 'show_delete_link': (not is_popup and has_delete_permission - and (change or show_delete)), + 'show_delete_link': (not is_popup and context['has_delete_permission'] + and (change or context['show_delete'])), 'show_save_as_new': not is_popup and change and bound_manipulator.save_as, - 'show_save_and_add_another': not is_popup and (not bound_manipulator.save_as or add), + 'show_save_and_add_another': not is_popup and (not bound_manipulator.save_as or context['add']), 'show_save_and_continue': not is_popup, 'show_save': True }