From d10a1c8693b1cd956d4a9b67cc18e6bab9feac8c Mon Sep 17 00:00:00 2001 From: Aevann1 Date: Tue, 28 Jun 2022 02:24:16 +0200 Subject: [PATCH] disable pinning for 3 days --- files/routes/admin.py | 2 +- files/routes/awards.py | 1 + files/routes/posts.py | 6 +++--- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/files/routes/admin.py b/files/routes/admin.py index 247aac42e..a8385fb34 100644 --- a/files/routes/admin.py +++ b/files/routes/admin.py @@ -1254,7 +1254,7 @@ def api_distinguish_post(post_id, v): @app.post("/sticky/") @admin_level_required(2) def sticky_post(post_id, v): - + abort(403) post = get_post(post_id) if post and not post.stickied: pins = g.db.query(Submission).filter(Submission.stickied != None, Submission.is_banned == False).count() diff --git a/files/routes/awards.py b/files/routes/awards.py index 94ebf394d..abedd7090 100644 --- a/files/routes/awards.py +++ b/files/routes/awards.py @@ -197,6 +197,7 @@ def award_thing(v, thing_type, id): if note: text += f" ({note})" notify_mod_action(v.id, text) elif kind == "pin": + abort(403) if thing.stickied and thing.stickied_utc: thing.stickied_utc += 3600 else: diff --git a/files/routes/posts.py b/files/routes/posts.py index d99338b0d..58ae602c0 100644 --- a/files/routes/posts.py +++ b/files/routes/posts.py @@ -1187,9 +1187,9 @@ def submit_post(v, sub=None): if body.startswith('!slots'): check_for_slots_command(body, snappy, c) - if body.startswith(':#marseypin:') or body.startswith(':#marseypin2:'): - post.stickied = "Snappy" - post.stickied_utc = int(time.time()) + 3600 + # if body.startswith(':#marseypin:') or body.startswith(':#marseypin2:'): + # post.stickied = "Snappy" + # post.stickied_utc = int(time.time()) + 3600 g.db.flush()