Ticket #5681: patch5681-1.diff
File patch5681-1.diff, 1.1 KB (added by , 16 years ago) |
---|
-
django/contrib/admin/options.py
801 801 802 802 if obj is None: 803 803 raise Http404(_('%(name)s object with primary key %(key)r does not exist.') % {'name': force_unicode(opts.verbose_name), 'key': escape(object_id)}) 804 805 if request.method == 'POST' and request.POST.has_key("_saveasnew"): 806 return self.add_view(request, form_url='../../add/') 807 804 808 805 ModelForm = self.get_form(request, obj) 809 806 formsets = [] 810 807 if request.method == 'POST': … … 826 823 formsets.append(formset) 827 824 828 825 if all_valid(formsets) and form_validated: 826 if request.POST.has_key("_saveasnew"): 827 return self.add_view(request, form_url='../../add/') 829 828 self.save_model(request, new_object, form, change=True) 830 829 form.save_m2m() 831 830 for formset in formsets: