From 1a922d455283b9c6c6dbd29c677f6e059b459a3e Mon Sep 17 00:00:00 2001 From: Cervinko Cera Date: Tue, 29 Mar 2016 00:30:59 +0200 Subject: [PATCH] Fix crash when 'view book after edit' is not checked --- cps/web.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cps/web.py b/cps/web.py index 11cee883..c0edd002 100755 --- a/cps/web.py +++ b/cps/web.py @@ -723,7 +723,7 @@ def edit_book(book_id): new_rating = db.Ratings(rating=int(to_save["rating"].strip())) book.ratings[0] = new_rating db.session.commit() - if to_save["detail_view"]: + if "detail_view" in to_save: return redirect(url_for('show_book', id=book.id)) else: return render_template('edit_book.html', book=book)