From c2267b690293bc3932dc2588df1d907a7d365f28 Mon Sep 17 00:00:00 2001 From: Ozzie Isaacs Date: Mon, 22 Jan 2024 13:17:27 +0100 Subject: [PATCH] Bugfix add to shelf --- cps/shelf.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/cps/shelf.py b/cps/shelf.py index abd28a26..9d969322 100644 --- a/cps/shelf.py +++ b/cps/shelf.py @@ -71,8 +71,7 @@ def add_to_shelf(shelf_id, book_id): else: maxOrder = maxOrder[0] - if not ub.session.query(ub.BookShelf).filter(ub.BookShelf.shelf == shelf_id, - ub.BookShelf.book_id == book_id).one_or_none(): + if not calibre_db.session.query(db.Books).filter(db.Books.id == book_id).one_or_none(): log.error("Invalid Book Id: %s. Could not be added to shelf %s", book_id, shelf.name) if not xhr: flash(_("%(book_id)s is a invalid Book Id. Could not be added to Shelf", book_id=book_id),