mirror of
https://github.com/django/django.git
synced 2025-09-03 17:21:00 +00:00
Fixed #14917 -- Hinted that view should redirect after form post success
This commit is contained in:
parent
e0fce8706d
commit
19a810b18c
1 changed files with 2 additions and 1 deletions
|
@ -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", {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue