Hi all,

i'm having a hard time figuring out where the error is in the following
code. Error msg is:
The view foo.users.views.updateinfo didn't return an HttpResponse
object.

I've followed religiously the ChangeManipulator example on the tutorial
and it seems to me that all code paths in this updateinfo method return
an HttpResponse.

Generally i'm having a hard time debugging the Django code i write...
would any of u please share some tips along with their answer to this
post? ;-)

Thanks,
Lorenzo

<code>
def updateinfo(request, user_id):
    try:
        manipulator = User.ChangeManipulator(user_id)
    except User.DoesNotExist:
        raise Http404

    u = manipulator.original_object

    if request.POST:
        new_data = request.POST.copy()
        errors = manipulator.get_validation_errors(new_data)
        if not errors:
            manipulator.do_html2python(new_data)
            manipulator.save(new_data)

            return HttpResponseRedirect("/users/edit/%i" % u.id)
        else:
            errors = {}
            new_data = u.__dict__

        form = forms.FormWrapper(manipulator, new_data, errors)
        return render_to_response('users/edit/edit_form.html', {'form':
form, 'u':u})
</code>


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

Reply via email to