for for editing Author

This commit is contained in:
Cervinko Cera 2016-04-03 23:22:26 +02:00
parent a96417f2a5
commit cb2ac4d142
1 changed files with 1 additions and 1 deletions

View File

@ -667,7 +667,7 @@ def edit_book(book_id):
author_id = book.authors[0].id
is_author = db.session.query(db.Authors).filter(db.Authors.name.like('%' + to_save["author_name"].strip() + '%')).first()
is_author = db.session.query(db.Authors).filter(db.Authors.name == to_save["author_name"].strip()).first()
if book.authors[0].name not in ("Unknown", "Unbekannt", "", " "):
if is_author:
book.authors.append(is_author)