remove empty pages

pull/226/head
Aevann 2024-05-17 17:09:02 +03:00
parent d7a2226fdb
commit 1bb9c25aa3
1 changed files with 3 additions and 0 deletions

View File

@ -157,6 +157,9 @@ def modmail_listing(v):
comments = g.db.query(Comment).filter(Comment.id == sq.c.top_comment_id).order_by(sq.c.created_utc.desc())
if v.admin_level < PERMS['VIEW_MODMAIL']:
comments = comments.filter_by(author_id=v.id)
total = comments.count()
listing = comments.order_by(Comment.id.desc()).offset(PAGE_SIZE*(page-1)).limit(PAGE_SIZE).all()