Ticket #23387: formset_save_as_validation.2.patch

File formset_save_as_validation.2.patch, 666 bytes (added by John R. Tipton, 10 years ago)

Updated Patch.

  • django/contrib/admin/options.py

    diff --git a/django/contrib/admin/options.py b/django/contrib/admin/options.py
    index 8a7483c..5f00d24 100644
    a b class ModelAdmin(BaseModelAdmin):  
    11811181            'preserved_filters': self.get_preserved_filters(request),
    11821182        }
    11831183        context.update(extra_context or {})
     1184        if request.method == 'POST' and not form_validated and "_saveasnew" in request.POST:
     1185            return self.render_change_form(request, context, form_url=form_url, change=True)
    11841186        return self.render_change_form(request, context, form_url=form_url, add=True)
    11851187
    11861188    @csrf_protect_m
Back to Top