From f4a26ab5c3ab94d327970efedb7bfbbe1a2121bf Mon Sep 17 00:00:00 2001 From: Aevann Date: Mon, 2 Oct 2023 08:12:38 +0300 Subject: [PATCH] dont allow pin awards on perma-pinned posts (it makes them pinned for 1 hour instead) --- files/routes/awards.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/files/routes/awards.py b/files/routes/awards.py index 6448af3345..0b382ef9ee 100644 --- a/files/routes/awards.py +++ b/files/routes/awards.py @@ -293,6 +293,9 @@ def award_thing(v, thing_type, id): if not FEATURES['PINS']: abort(403) if thing.is_banned: abort(403) + if thing.stickied and not thing.stickied_utc: + abort(400, f"This {thing_type} is already pinned permanently!") + if thing_type == 'comment': add = 3600*6 else: add = 3600