"if request.POST" should read "if request.method == 'POST'"
|Reported by:||davidschein@…||Owned by:||jacob|
|Has patch:||no||Needs documentation:||no|
|Needs tests:||no||Patch needs improvement:||no|
It's possible that a request can come in via POST with an empty POST dictionary -- if, say, a form is requested via the POST HTTP method but does not include form data. Therefore, you shouldn't use if request.POST to check for use of the POST method; instead, use if request.method == "POST" (see above).
Then in http://www.djangoproject.com/documentation/forms/
we violate that advice with:
def create_place(request): manipulator = Place.AddManipulator() if request.POST: ...
Change History (6)
comment:1 Changed 8 years ago by mtredinnick
- Resolution set to fixed
- Status changed from new to closed
comment:2 Changed 8 years ago by Gary Wilson <gary.wilson@…>
- Resolution fixed deleted
- Status changed from closed to reopened