fix unstickying

This commit is contained in:
justcool393 2023-02-20 18:01:28 -06:00 committed by Ben Rog-Wilhelm
parent 872d9c613b
commit 449e2557d0

View file

@ -1223,8 +1223,8 @@ def sticky_post(post_id, v):
@admin_level_required(2) @admin_level_required(2)
def unsticky_post(post_id, v): def unsticky_post(post_id, v):
post = g.db.query(Submission).filter_by(id=post_id).one_or_none() post = g.db.query(Submission).filter_by(id=post_id).one_or_none()
if FEATURES['AWARDS'] and post and post.stickied: if post and post.stickied:
if post.stickied.endswith('(pin award)'): abort(403, "Can't unpin award pins!") if FEATURES['AWARDS'] and post.stickied.endswith('(pin award)'): abort(403, "Can't unpin award pins!")
post.stickied = None post.stickied = None
post.stickied_utc = None post.stickied_utc = None
@ -1275,8 +1275,8 @@ def sticky_comment(cid, v):
def unsticky_comment(cid, v): def unsticky_comment(cid, v):
comment = get_comment(cid, v=v) comment = get_comment(cid, v=v)
if FEATURES['AWARDS'] and comment.is_pinned: if comment.is_pinned:
if comment.is_pinned.endswith("(pin award)"): abort(403, "Can't unpin award pins!") if FEATURES['AWARDS'] and comment.is_pinned.endswith("(pin award)"): abort(403, "Can't unpin award pins!")
comment.is_pinned = None comment.is_pinned = None
g.db.add(comment) g.db.add(comment)