Fix crash due to relations not supporting is_
This commit is contained in:
@@ -131,7 +131,7 @@ def tags():
|
|||||||
|
|
||||||
only_no_tags = isYes(request.args.get("no_tags"))
|
only_no_tags = isYes(request.args.get("no_tags"))
|
||||||
if only_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()
|
tags = Tag.query.order_by(db.asc(Tag.title)).all()
|
||||||
|
|
||||||
|
|||||||
@@ -27,7 +27,7 @@ from app.tasks import celery
|
|||||||
def delete_inactive_users():
|
def delete_inactive_users():
|
||||||
threshold = datetime.datetime.now() - datetime.timedelta(hours=5)
|
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()
|
User.created_at <= threshold, User.rank == UserRank.NOT_JOINED).all()
|
||||||
for user in users:
|
for user in users:
|
||||||
db.session.delete(user)
|
db.session.delete(user)
|
||||||
|
|||||||
Reference in New Issue
Block a user