1
0
mirror of https://github.com/django/django.git synced 2025-10-30 17:16:10 +00:00

Fixed #13875 -- Made admin's submit_row template tag pass whole context.

This commit is contained in:
Federico Capoano
2016-02-04 17:17:28 +01:00
committed by Tim Graham
parent dcee1dfc79
commit e972a7d03d
2 changed files with 30 additions and 8 deletions

View File

@@ -1,6 +1,7 @@
import json
from django import template
from django.template.context import Context
register = template.Library()
@@ -43,14 +44,13 @@ def submit_row(context):
"""
Displays the row of buttons for delete and save.
"""
opts = context['opts']
change = context['change']
is_popup = context['is_popup']
save_as = context['save_as']
show_save = context.get('show_save', True)
show_save_and_continue = context.get('show_save_and_continue', True)
ctx = {
'opts': opts,
ctx = Context(context)
ctx.update({
'show_delete_link': (
not is_popup and context['has_delete_permission'] and
change and context.get('show_delete', True)
@@ -61,12 +61,8 @@ def submit_row(context):
(not save_as or context['add'])
),
'show_save_and_continue': not is_popup and context['has_change_permission'] and show_save_and_continue,
'is_popup': is_popup,
'show_save': show_save,
'preserved_filters': context.get('preserved_filters'),
}
if context.get('original') is not None:
ctx['original'] = context['original']
})
return ctx