Django - ValueError on HttpResponseRedirect
-
09-03-2021 - |
Question
i have this view: http://dpaste.com/661912/ on which i have an error: ValueError at /fattura/save/ ... the view didn't return an HttpResponse object. i dont know why since i have on the same project another really similar view: http://dpaste.com/661913/ that works correctly.
this is the urlconf:
# urls.py
from django.conf.urls.defaults import patterns, include, url
# Uncomment the next two lines to enable the admin:
from django.contrib import admin
admin.autodiscover()
urlpatterns = patterns('',
...
url(r'^soggetto/save/','gpf1.views.anagrafica_save'),
...
url(r'^fattura/save/','gpf1.views.fattura_save'),
# Uncomment the admin/doc line below to enable admin documentation:
url(r'^admin/doc/', include('django.contrib.admindocs.urls')),
# Uncomment the next line to enable the admin:
url(r'^admin/', include(admin.site.urls)),
)
also here there's no big differences. any help?
thanks
Solution
Have a look at that view, and work out what is returned if either the request is not a POST, or the form is not valid. Then you will have enough information to answer the question by yourself.
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow