diff --git a/files/helpers/cron.py b/files/helpers/cron.py index e6bbb3ca9..9bb364739 100644 --- a/files/helpers/cron.py +++ b/files/helpers/cron.py @@ -214,6 +214,7 @@ def _delete_all_posts(): p.deleted_utc = int(time.time()) p.is_pinned = False p.stickied = None + p.stickied_utc = None g.db.add(p) cache.delete_memoized(frontlist) diff --git a/files/routes/admin.py b/files/routes/admin.py index 623418e31..3ecde556f 100644 --- a/files/routes/admin.py +++ b/files/routes/admin.py @@ -1345,8 +1345,11 @@ def remove_post(post_id, v): post = get_post(post_id) post.is_banned = True post.is_approved = None + if not FEATURES['AWARDS'] or not post.stickied or not post.stickied.endswith(PIN_AWARD_TEXT): post.stickied = None + post.stickied_utc = None + post.is_pinned = False post.ban_reason = v.username g.db.add(post) @@ -1569,6 +1572,7 @@ def unsticky_comment(cid, v): abort(403, "Can't unpin award pins!") comment.stickied = None + comment.stickied_utc = None g.db.add(comment) ma=ModAction( diff --git a/files/routes/comments.py b/files/routes/comments.py index 4dfa65360..4846ceec8 100644 --- a/files/routes/comments.py +++ b/files/routes/comments.py @@ -533,6 +533,7 @@ def unpin_comment(cid, v): abort(403, "You can only unpin comments you have pinned!") comment.stickied = None + comment.stickied_utc = None g.db.add(comment) if v.id != comment.author_id: diff --git a/files/routes/posts.py b/files/routes/posts.py index 055d10c75..fc3273d3d 100644 --- a/files/routes/posts.py +++ b/files/routes/posts.py @@ -722,6 +722,7 @@ def delete_post_pid(pid, v): p.deleted_utc = int(time.time()) p.is_pinned = False p.stickied = None + p.stickied_utc = None g.db.add(p) diff --git a/files/routes/subs.py b/files/routes/subs.py index ce9dda674..cd9739274 100644 --- a/files/routes/subs.py +++ b/files/routes/subs.py @@ -824,6 +824,7 @@ def unpin_comment_mod(cid, v): if not (comment.post.sub and v.mods(comment.post.sub)): abort(403) comment.stickied = None + comment.stickied_utc = None g.db.add(comment) ma = SubAction(