From d6fbcdb09d2c1783091e85157b6d820a2dd8e38c Mon Sep 17 00:00:00 2001 From: OzzieIsaacs Date: Tue, 8 Dec 2020 13:56:17 +0100 Subject: [PATCH] Fix merge problem (ub prefix in ub.py) --- cps/ub.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/cps/ub.py b/cps/ub.py index d7900737..68e866fb 100644 --- a/cps/ub.py +++ b/cps/ub.py @@ -677,20 +677,20 @@ def update_download(book_id, user_id): if not check: new_download = Downloads(user_id=user_id, book_id=book_id) - ub.session.add(new_download) + session.add(new_download) try: - ub.session.commit() + session.commit() except exc.OperationalError: - ub.session.rollback() + session.rollback() # Delete non exisiting downloaded books in calibre-web's own database def delete_download(book_id): - ub.session.query(Downloads).filter(book_id == Downloads.book_id).delete() + session.query(Downloads).filter(book_id == Downloads.book_id).delete() try: - ub.session.commit() + session.commit() except exc.OperationalError: - ub.session.rollback() + session.rollback() # Generate user Guest (translated text), as anonymous user, no rights def create_anonymous_user(session):