Commit 1a922d45 authored by Cervinko Cera's avatar Cervinko Cera

Fix crash when 'view book after edit' is not checked

parent cd0aeb28
......@@ -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)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment