Strange behavior when the method is POST:
code:
def view_method_start(request):
    if has_error:
         return HttpResponse("Something")

    if request.method=='POST':
        new_data = request.POST.copy()
        new_data.update(request.FILES)
        ... process ...
        return HttpResponse("success")

    return HttpResponse("Something2")
...

When has_error is True, the content length of response is the same as
that of "Something", but the browser (Firefox/IE) response with
connection reset.

But if I place:
if request.method=='POST':
    new_data = request.POST.copy()
    new_data.update(request.FILES)
at the beginning, i.e.
def view_method_start(request):
    if request.method=='POST':
        new_data = request.POST.copy()
        new_data.update(request.FILES)
    else:
        return HttpResponse("Something2")

    if has_error:
         return HttpResponse("Something")

   ... process ...
   return HttpResponse("success")
everything becomes normal.

Is it a bugs?


--~--~---------~--~----~------------~-------~--~----~
 You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to