From efd93855d9448a6773062cad140421d135093a0f Mon Sep 17 00:00:00 2001 From: Mouse Reeve Date: Tue, 18 Feb 2020 23:09:22 -0800 Subject: [PATCH] Redirect invalid reviews back to book page Works on #17 --- fedireads/views.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/fedireads/views.py b/fedireads/views.py index 2ccd08f41..d4fe215fa 100644 --- a/fedireads/views.py +++ b/fedireads/views.py @@ -238,10 +238,10 @@ def shelve(request, username, shelf_id, book_id, reshelve=True): def review(request): ''' create a book review note ''' form = forms.ReviewForm(request.POST) + book_identifier = request.POST.get('book') # TODO: better failure behavior if not form.is_valid(): - return redirect('/') - book_identifier = request.POST.get('book') + return redirect('/book/%s' % book_identifier) # TODO: validation, htmlification name = form.data.get('name')