Ticket #13875: 13875_submit_row_whole_context.diff

File 13875_submit_row_whole_context.diff, 1.3 KB (added by Julien Phalip, 14 years ago)
  • django/contrib/admin/templatetags/admin_modify.py

    diff --git a/django/contrib/admin/templatetags/admin_modify.py b/django/contrib/admin/templatetags/admin_modify.py
    index fe88043..fd8c420 100644
    a b  
    11from django import template
     2from django.template.context import Context
    23
    34register = template.Library()
    45
    def submit_row(context):  
    2728    change = context['change']
    2829    is_popup = context['is_popup']
    2930    save_as = context['save_as']
    30     return {
     31    new_context = Context(context)
     32    new_context.update({
    3133        'onclick_attrib': (opts.get_ordered_objects() and change
    3234                            and 'onclick="submitOrderForm();"' or ''),
    3335        'show_delete_link': (not is_popup and context['has_delete_permission']
    def submit_row(context):  
    3638        'show_save_and_add_another': context['has_add_permission'] and
    3739                            not is_popup and (not save_as or context['add']),
    3840        'show_save_and_continue': not is_popup and context['has_change_permission'],
    39         'is_popup': is_popup,
    4041        'show_save': True
    41     }
     42    })
     43    return new_context
    4244submit_row = register.inclusion_tag('admin/submit_line.html', takes_context=True)(submit_row)
Back to Top