summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMalcolm Tredinnick <malcolm.tredinnick@gmail.com>2008-09-17 08:59:55 +0000
committerMalcolm Tredinnick <malcolm.tredinnick@gmail.com>2008-09-17 08:59:55 +0000
commit0aff292bcfacf23d5721dec6dcce9e64889740cb (patch)
treee09ca78bd7f1690b378783a33f40cfd5eb9d6181
parenta10fcbdb8b36e12fb839c7e760f047568877e9da (diff)
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
-rw-r--r--django/contrib/admin/options.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/django/contrib/admin/options.py b/django/contrib/admin/options.py
index ea322dab14..7f464baec3 100644
--- a/django/contrib/admin/options.py
+++ b/django/contrib/admin/options.py
@@ -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)