This commit is contained in:
Aevann1 2021-12-23 16:55:44 +02:00
parent fa026dc149
commit cac84d9a95
7 changed files with 68 additions and 11 deletions

View file

@ -1014,7 +1014,7 @@ def api_sticky_post(post_id, v):
post = g.db.query(Submission).filter_by(id=post_id).first()
if post:
if post.stickied:
if post.stickied.startswith("t:"): abort(403)
if post.stickied.startswith("t:"): return {"error": "Can't unpin temporary pins!"}, 403
else: post.stickied = None
else:
pins = g.db.query(Submission.id).filter(Submission.stickied != None, Submission.is_banned == False).count()