Commit 0aff292b authored by Malcolm Tredinnick's avatar Malcolm Tredinnick
Browse files

Changed a slightly suspicious usage of request.POST to request.method == 'POST'.

Refs #9014 (not the root cause of that bug, but discovered whilst people were
diagnosing it).


git-svn-id: http://code.djangoproject.com/svn/django/trunk@9063 bcc190cf-cafb-0310-a4f2-bffc1f526a37
parent a10fcbdb
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -558,7 +558,7 @@ class ModelAdmin(BaseModelAdmin):
        if obj is None:
            raise Http404('%s object with primary key %r does not exist.' % (force_unicode(opts.verbose_name), escape(object_id)))

        if request.POST and request.POST.has_key("_saveasnew"):
        if request.method == 'POST' and request.POST.has_key("_saveasnew"):
            return self.add_view(request, form_url='../../add/')

        ModelForm = self.get_form(request, obj)