From a3730537aa6d4a62f5141a27a5f93a9954ff0e13 Mon Sep 17 00:00:00 2001 From: Aevann Date: Wed, 22 May 2024 23:44:00 +0300 Subject: [PATCH] fix disappearing post --- files/routes/users.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/files/routes/users.py b/files/routes/users.py index c021a1341..a187cf3b5 100644 --- a/files/routes/users.py +++ b/files/routes/users.py @@ -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