fix disappearing post

master
Aevann 2024-05-22 23:44:00 +03:00
parent fed00f4f8d
commit a3730537aa
1 changed files with 7 additions and 1 deletions

View File

@ -988,7 +988,13 @@ def u_username(v, username):
if page == 1 and sort == 'new':
pinned = []
pinned = g.db.query(Post).filter_by(profile_pinned=True, author_id=u.id, is_banned=False).all()
pinned = g.db.query(Post).filter_by(profile_pinned=True, author_id=u.id)
if v.id != u.id and v.admin_level < PERMS['POST_COMMENT_MODERATION']:
pinned = pinned.filter_by(is_banned=False)
pinned = pinned.all()
for p in pinned:
ids = [p.id] + ids