forked from rDrama/rDrama
make sure to wipe stickied_utc too
parent
e9ee73ec3d
commit
8e27789847
|
@ -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)
|
||||
|
|
|
@ -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(
|
||||
|
|
|
@ -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:
|
||||
|
|
|
@ -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)
|
||||
|
||||
|
|
|
@ -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(
|
||||
|
|
Loading…
Reference in New Issue