1
0
mirror of https://github.com/janeczku/calibre-web synced 2025-10-28 22:07:41 +00:00

Code refactoring and improved error handling for edit user list

Update teststatus
This commit is contained in:
Ozzie Isaacs
2021-04-04 19:40:34 +02:00
parent 665210e506
commit 8acd1f1fe4
18 changed files with 624 additions and 538 deletions

View File

@@ -544,8 +544,8 @@ class CalibreDB():
conn = cls.engine.connect()
# conn.text_factory = lambda b: b.decode(errors = 'ignore') possible fix for #1302
except Exception as e:
config.invalidate(e)
except Exception as ex:
config.invalidate(ex)
return False
config.db_configured = True
@@ -646,8 +646,8 @@ class CalibreDB():
pagination = Pagination(page, pagesize,
len(query.all()))
entries = query.order_by(*order).offset(off).limit(pagesize).all()
except Exception as e:
log.debug_or_exception(e)
except Exception as ex:
log.debug_or_exception(ex)
#for book in entries:
# book = self.order_authors(book)
return entries, randm, pagination
@@ -791,7 +791,7 @@ class CalibreDB():
def lcase(s):
try:
return unidecode.unidecode(s.lower())
except Exception as e:
except Exception as ex:
log = logger.create()
log.debug_or_exception(e)
log.debug_or_exception(ex)
return s.lower()