make it not possible to sticky removed comments

pull/96/head
Aevann 2023-01-24 12:23:19 +02:00
parent 7eec8af383
commit c1268d396b
1 changed files with 3 additions and 0 deletions

View File

@ -1446,6 +1446,9 @@ def unsticky_post(post_id, v):
@admin_level_required(PERMS['POST_COMMENT_MODERATION'])
def sticky_comment(cid, v):
comment = get_comment(cid, v=v)
if comment.is_banned:
abort(403, "Can't sticky removed comments!")
if not comment.stickied:
comment.stickied = v.username