From b5b3b9dcc3bd08df7217d8f9cdff1dc260a4b7d8 Mon Sep 17 00:00:00 2001 From: Aevann1 Date: Mon, 5 Dec 2022 18:01:13 +0200 Subject: [PATCH] fix pin awards --- files/routes/awards.py | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/files/routes/awards.py b/files/routes/awards.py index c382206545..3defb8176c 100644 --- a/files/routes/awards.py +++ b/files/routes/awards.py @@ -238,14 +238,16 @@ def award_thing(v, thing_type, id): elif kind == "pin": if not FEATURES['PINS']: abort(403) if thing.is_banned: abort(403) - if thing.stickied and thing.stickied_utc: - thing.stickied_utc += 3600 + + if thing_type == 'comment': add = 3600*6 + else: add = 3600 + + if thing.stickied_utc: + thing.stickied_utc += add else: - thing.stickied = f'{v.username}{PIN_AWARD_TEXT}' - if thing_type == 'comment': - thing.stickied_utc = int(time.time()) + 3600*6 - else: - thing.stickied_utc = int(time.time()) + 3600 + thing.stickied_utc = int(time.time()) + add + + thing.stickied = f'{v.username}{PIN_AWARD_TEXT}' g.db.add(thing) cache.delete_memoized(frontlist) elif kind == "unpin":