Skip to content

Commit

Permalink
Bugfix add to shelf
Browse files Browse the repository at this point in the history
  • Loading branch information
OzzieIsaacs committed Jan 22, 2024
1 parent 706b9c4 commit 0e5520a
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions cps/shelf.py
Original file line number Diff line number Diff line change
Expand Up @@ -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),
Expand Down

0 comments on commit 0e5520a

Please sign in to comment.