1
0
mirror of https://github.com/janeczku/calibre-web synced 2024-11-24 10:37:23 +00:00

Bugfix add to shelf

This commit is contained in:
Ozzie Isaacs 2024-01-22 13:17:27 +01:00
parent 6f5e9f167e
commit c2267b6902

View File

@ -71,8 +71,7 @@ def add_to_shelf(shelf_id, book_id):
else: else:
maxOrder = maxOrder[0] maxOrder = maxOrder[0]
if not ub.session.query(ub.BookShelf).filter(ub.BookShelf.shelf == shelf_id, if not calibre_db.session.query(db.Books).filter(db.Books.id == book_id).one_or_none():
ub.BookShelf.book_id == book_id).one_or_none():
log.error("Invalid Book Id: %s. Could not be added to shelf %s", book_id, shelf.name) log.error("Invalid Book Id: %s. Could not be added to shelf %s", book_id, shelf.name)
if not xhr: if not xhr:
flash(_("%(book_id)s is a invalid Book Id. Could not be added to Shelf", book_id=book_id), flash(_("%(book_id)s is a invalid Book Id. Could not be added to Shelf", book_id=book_id),