1
0
mirror of https://github.com/janeczku/calibre-web synced 2024-11-28 12:30:00 +00:00

Fix merge problem (ub prefix in ub.py)

This commit is contained in:
OzzieIsaacs 2020-12-08 13:56:17 +01:00
parent d39b28b011
commit d6fbcdb09d

View File

@ -677,20 +677,20 @@ def update_download(book_id, user_id):
if not check: if not check:
new_download = Downloads(user_id=user_id, book_id=book_id) new_download = Downloads(user_id=user_id, book_id=book_id)
ub.session.add(new_download) session.add(new_download)
try: try:
ub.session.commit() session.commit()
except exc.OperationalError: except exc.OperationalError:
ub.session.rollback() session.rollback()
# Delete non exisiting downloaded books in calibre-web's own database # Delete non exisiting downloaded books in calibre-web's own database
def delete_download(book_id): 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: try:
ub.session.commit() session.commit()
except exc.OperationalError: except exc.OperationalError:
ub.session.rollback() session.rollback()
# Generate user Guest (translated text), as anonymous user, no rights # Generate user Guest (translated text), as anonymous user, no rights
def create_anonymous_user(session): def create_anonymous_user(session):