dont allow pin awards on perma-pinned posts (it makes them pinned for 1 hour instead)

pull/211/head
Aevann 2023-10-02 08:12:38 +03:00
parent 124da7d562
commit f4a26ab5c3
1 changed files with 3 additions and 0 deletions

View File

@ -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