From 0a9e7b3ef4d01f71b4cda6094bd73748237a8b63 Mon Sep 17 00:00:00 2001 From: justcool393 Date: Sun, 23 Oct 2022 12:14:27 -0500 Subject: [PATCH] lawlzposts: don't allow unpin awards lawlzposts: disable if pins feature flag is off --- files/helpers/actions.py | 1 + files/routes/awards.py | 1 + 2 files changed, 2 insertions(+) diff --git a/files/helpers/actions.py b/files/helpers/actions.py index 38898ad30..829cdf55e 100644 --- a/files/helpers/actions.py +++ b/files/helpers/actions.py @@ -421,6 +421,7 @@ def execute_antispam_comment_check(body, v): def execute_lawlz_actions(v:User, p:Submission): if v.id != LAWLZ_ID: return if SITE_NAME != 'rDrama': return + if not FEATURES['PINS']: return p.stickied_utc = int(time.time()) + 86400 p.stickied = v.username p.distinguish_level = 6 diff --git a/files/routes/awards.py b/files/routes/awards.py index 99d47524f..b700509f3 100644 --- a/files/routes/awards.py +++ b/files/routes/awards.py @@ -233,6 +233,7 @@ def award_thing(v, thing_type, id): cache.delete_memoized(frontlist) elif kind == "unpin": if not thing.stickied_utc: abort(403) + if thing.author_id == LAWLZ_ID and SITE_NAME == 'rDrama': abort(403, "You can't unpin lawlzposts!") if thing_type == 'comment': t = thing.stickied_utc - 3600*6