Fixed #14917 -- Hinted that view should redirect after form post success

This commit is contained in:
Claude Paroz 2012-06-23 18:44:40 +02:00
parent e0fce8706d
commit 19a810b18c
1 changed files with 2 additions and 1 deletions

View File

@ -877,7 +877,8 @@ of a model. Here's how you can do that::
formset = BookInlineFormSet(request.POST, request.FILES, instance=author) formset = BookInlineFormSet(request.POST, request.FILES, instance=author)
if formset.is_valid(): if formset.is_valid():
formset.save() formset.save()
# Do something. # Do something. Should generally end with a redirect. For example:
return HttpResponseRedirect(author.get_absolute_url())
else: else:
formset = BookInlineFormSet(instance=author) formset = BookInlineFormSet(instance=author)
return render_to_response("manage_books.html", { return render_to_response("manage_books.html", {