fixed BUG-36 -- form value for owned was not an int, so comparison was failing, fixed now
This commit is contained in:
8
main.py
8
main.py
@@ -651,11 +651,11 @@ def new_book():
|
||||
alert="danger"
|
||||
message="Failed to create Book."
|
||||
for field in form.errors:
|
||||
message = "{}<br>{}={}".format( message, field, form.errors[field] )
|
||||
message = f"{message}<br>{field}={form.errors}"
|
||||
if len(book_genres) == 0:
|
||||
message = "{}<br>book has to have a genre selected".format( message )
|
||||
if request.form['owned'] != ON_WISHLIST and not request.form['year_published'].isnumeric():
|
||||
message = "{}<br>book is not on wish list, so needs a year_published between 1850 & 2100".format( message )
|
||||
message = f"{message}<br>book has to have a genre selected"
|
||||
if int(request.form['owned']) != int(ON_WISHLIST) and not request.form['year_published'].isnumeric():
|
||||
message = f"{message}<br>book is not on wish list {request.form['owned']}, so needs a year_published between 1850 & 2100"
|
||||
|
||||
print( "ERROR: Failed to create book: {}".format(message) )
|
||||
if request.form['year_published'].isnumeric():
|
||||
|
||||
Reference in New Issue
Block a user