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 }