From 0e5520a2615f0d5f21ed52656efe9d3b15a95cd2 Mon Sep 17 00:00:00 2001 From: Ozzie Isaacs Date: Mon, 22 Jan 2024 13:16:58 +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),