"if request.POST" should read "if request.method == 'POST'"
|Reported by:||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: ...