From fb13272e6cbfd15d57a3ab020b2ae0b8f8aa43a4 Mon Sep 17 00:00:00 2001 From: rubenwardy Date: Sat, 18 Mar 2023 23:20:09 +0000 Subject: [PATCH] Fix crash due to relations not supporting is_ --- app/blueprints/todo/__init__.py | 2 +- app/tasks/usertasks.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/blueprints/todo/__init__.py b/app/blueprints/todo/__init__.py index aada86e3..a0e881c0 100644 --- a/app/blueprints/todo/__init__.py +++ b/app/blueprints/todo/__init__.py @@ -131,7 +131,7 @@ def tags(): only_no_tags = isYes(request.args.get("no_tags")) if only_no_tags: - query = query.filter(Package.tags.is_(None)) + query = query.filter(Package.tags==None) tags = Tag.query.order_by(db.asc(Tag.title)).all() diff --git a/app/tasks/usertasks.py b/app/tasks/usertasks.py index 37caba93..0f45457a 100644 --- a/app/tasks/usertasks.py +++ b/app/tasks/usertasks.py @@ -27,7 +27,7 @@ from app.tasks import celery def delete_inactive_users(): threshold = datetime.datetime.now() - datetime.timedelta(hours=5) - users = User.query.filter(User.is_active == False, User.packages.is_(None), User.forum_topics.is_(None), + users = User.query.filter(User.is_active == False, User.packages == None, User.forum_topics == None, User.created_at <= threshold, User.rank == UserRank.NOT_JOINED).all() for user in users: db.session.delete(user)