disable pinning for 3 days

master
Aevann1 2022-06-28 02:24:16 +02:00
parent 79479d9ffd
commit d10a1c8693
3 changed files with 5 additions and 4 deletions

View File

@ -1254,7 +1254,7 @@ def api_distinguish_post(post_id, v):
@app.post("/sticky/<post_id>")
@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()

View File

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

View File

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