Hi there, i have a simple view in wich i'm saving a form. the code seems 'clean',but i can't get rid of the error : "The view didn't return an HttpResponse object." Though i've searched on the web, i did not find a relevant indication.
def classroom_privacy(request,classname):
theclass = Classroom.objects.get(classname=classname)
if request.method == 'POST':
form = PrivacyClass(request.POST)
if form.is_valid():
new_obj = form.save(commit=False)
new_obj.save()
return HttpResponseRedirect('.')
else:
form = PrivacyClass()
return render_to_response('classroom/classroom_privacy.html', {'form': form},
context_instance=RequestContext(request))
Thanks!