Skip to content

Commit 19a810b

Browse files
committed
Fixed django#14917 -- Hinted that view should redirect after form post success
1 parent e0fce87 commit 19a810b

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

docs/topics/forms/modelforms.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -877,7 +877,8 @@ of a model. Here's how you can do that::
877877
formset = BookInlineFormSet(request.POST, request.FILES, instance=author)
878878
if formset.is_valid():
879879
formset.save()
880-
# Do something.
880+
# Do something. Should generally end with a redirect. For example:
881+
return HttpResponseRedirect(author.get_absolute_url())
881882
else:
882883
formset = BookInlineFormSet(instance=author)
883884
return render_to_response("manage_books.html", {

0 commit comments

Comments
 (0)