From 4b37bd721b0bab137762947c4fdef87fcf042198 Mon Sep 17 00:00:00 2001 From: Aevann1 Date: Mon, 24 Oct 2022 19:36:35 +0200 Subject: [PATCH] prevent carp from undoing award pins --- files/classes/user.py | 2 +- files/routes/admin.py | 2 -- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/files/classes/user.py b/files/classes/user.py index a070a658c..99529b9a6 100644 --- a/files/classes/user.py +++ b/files/classes/user.py @@ -462,7 +462,7 @@ class User(Base): if self.shadowbanned and not (v and v.can_see_shadowbanned): return [] - posts = g.db.query(Submission.id).filter_by(author_id=self.id, is_pinned=False) + posts = g.db.query(Submission.id).filter_by(author_id=self.id, is_pinned=False, is_banned=False) if not (v and (v.admin_level >= PERMS['POST_COMMENT_MODERATION'] or v.id == self.id)): posts = posts.filter_by(is_banned=False, private=False, ghost=False, deleted_utc=0) diff --git a/files/routes/admin.py b/files/routes/admin.py index f1d5cc9dc..0b9229aec 100644 --- a/files/routes/admin.py +++ b/files/routes/admin.py @@ -1121,8 +1121,6 @@ def remove_post(post_id, v): post = get_post(post_id) post.is_banned = True post.is_approved = None - post.stickied = None - post.is_pinned = False post.ban_reason = v.username g.db.add(post)