This commit is contained in:
Aevann1 2021-10-21 16:47:27 +02:00
parent bcf7d8c456
commit 2cce840c39
61 changed files with 157 additions and 120 deletions

View file

@ -810,10 +810,11 @@ def toggle_pin_comment(cid, v):
comment = get_comment(cid, v=v)
if v.admin_level < 1 and v.id != comment.post.author_id:
abort(403)
if v.admin_level < 1 and v.id != comment.post.author_id: abort(403)
if comment.is_pinned: comment.is_pinned = None
if comment.is_pinned:
if comment.is_pinned.startswith("t:"): abort(403)
else: comment.is_pinned = None
else: comment.is_pinned = v.username
g.db.add(comment)