From f3d88fc746402a45ab72488d44ae31dab6ace35d Mon Sep 17 00:00:00 2001 From: Ozzie Isaacs Date: Sat, 20 Mar 2021 09:31:29 +0100 Subject: [PATCH] Update sqlalchemy 1.4 working --- cps/db.py | 3 ++- requirements.txt | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/cps/db.py b/cps/db.py index 3eec6454..7e908476 100644 --- a/cps/db.py +++ b/cps/db.py @@ -619,9 +619,10 @@ class CalibreDB(): randm = false() off = int(int(pagesize) * (page - 1)) query = self.session.query(database) \ - .join(*join, isouter=True) \ .filter(db_filter) \ .filter(self.common_filters(allow_show_archived)) + if len(join): + query = query.join(*join, isouter=True) entries = list() pagination = list() try: diff --git a/requirements.txt b/requirements.txt index 04aaa000..ca11eff9 100644 --- a/requirements.txt +++ b/requirements.txt @@ -9,7 +9,7 @@ iso-639>=0.4.5,<0.5.0 PyPDF3>=1.0.0,<1.0.4 pytz>=2016.10 requests>=2.11.1,<2.25.0 -SQLAlchemy>=1.3.0,<1.4.0 +SQLAlchemy>=1.3.0,<1.5.0 tornado>=4.1,<6.2 Wand>=0.4.4,<0.7.0 unidecode>=0.04.19,<1.2.0