Fixed BUG-18 -> cannot find book
This commit is contained in:
3
BUGs
3
BUGs
@@ -1,5 +1,4 @@
|
|||||||
#### BUGS (next-18)
|
#### BUGS (next-19)
|
||||||
BUG-18: delete a book, then go to that URL and you get odd DB errors, rather than book not found
|
|
||||||
|
|
||||||
### DB/back-end
|
### DB/back-end
|
||||||
BUG-2: series does not deal with calcd_rating...
|
BUG-2: series does not deal with calcd_rating...
|
||||||
|
|||||||
5
main.py
5
main.py
@@ -593,6 +593,11 @@ def book(id):
|
|||||||
st.SetMessage(message)
|
st.SetMessage(message)
|
||||||
else:
|
else:
|
||||||
book = Book.query.get(id)
|
book = Book.query.get(id)
|
||||||
|
if book == None:
|
||||||
|
st.SetAlert("danger")
|
||||||
|
st.SetMessage("Cannot find Book (id={})".format(id))
|
||||||
|
return render_template("base.html", alert=st.GetAlert(), message=st.GetMessage())
|
||||||
|
|
||||||
book_form=BookForm(obj=book)
|
book_form=BookForm(obj=book)
|
||||||
|
|
||||||
author_list = GetAuthors()
|
author_list = GetAuthors()
|
||||||
|
|||||||
Reference in New Issue
Block a user