remotes/1693045480750635534/spooky-22
Aevann1 2021-08-31 18:10:57 +02:00
parent c139f88563
commit a42b1282d2
1 changed files with 2 additions and 3 deletions

View File

@ -24,9 +24,8 @@ def notifications(v):
messages = request.args.get('messages', False)
posts = request.args.get('posts', False)
if messages:
if v.admin_level == 6: comments = g.db.query(Comment).filter(or_(Comment.author_id==v.id, Comment.sentto==v.id, Comment.sentto==0)).filter(Comment.parent_submission == None).order_by(Comment.created_utc.desc()).offset(25 * (page - 1)).limit(50).all()
else: comments = g.db.query(Comment).filter(or_(Comment.author_id==v.id, Comment.sentto==v.id)).filter(Comment.parent_submission == None).order_by(Comment.created_utc.desc()).offset(25 * (page - 1)).limit(50).all()
comments = [c for c in comments if c.child_comments == []][:26]
if v.admin_level == 6: comments = g.db.query(Comment).filter(or_(Comment.author_id==v.id, Comment.sentto==v.id, Comment.sentto==0)).filter(Comment.parent_submission == None).order_by(Comment.created_utc.desc()).offset(25 * (page - 1)).limit(26).all()
else: comments = g.db.query(Comment).filter(or_(Comment.author_id==v.id, Comment.sentto==v.id)).filter(Comment.parent_submission == None).order_by(Comment.created_utc.desc()).offset(25 * (page - 1)).limit(26).all()
next_exists = (len(comments) == 26)
comments = comments[:25]
elif posts: