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.deleted_utc = int(time.time())
|
||||||
p.is_pinned = False
|
p.is_pinned = False
|
||||||
p.stickied = None
|
p.stickied = None
|
||||||
|
p.stickied_utc = None
|
||||||
g.db.add(p)
|
g.db.add(p)
|
||||||
|
|
||||||
cache.delete_memoized(frontlist)
|
cache.delete_memoized(frontlist)
|
||||||
|
|
|
@ -1345,8 +1345,11 @@ def remove_post(post_id, v):
|
||||||
post = get_post(post_id)
|
post = get_post(post_id)
|
||||||
post.is_banned = True
|
post.is_banned = True
|
||||||
post.is_approved = None
|
post.is_approved = None
|
||||||
|
|
||||||
if not FEATURES['AWARDS'] or not post.stickied or not post.stickied.endswith(PIN_AWARD_TEXT):
|
if not FEATURES['AWARDS'] or not post.stickied or not post.stickied.endswith(PIN_AWARD_TEXT):
|
||||||
post.stickied = None
|
post.stickied = None
|
||||||
|
post.stickied_utc = None
|
||||||
|
|
||||||
post.is_pinned = False
|
post.is_pinned = False
|
||||||
post.ban_reason = v.username
|
post.ban_reason = v.username
|
||||||
g.db.add(post)
|
g.db.add(post)
|
||||||
|
@ -1569,6 +1572,7 @@ def unsticky_comment(cid, v):
|
||||||
abort(403, "Can't unpin award pins!")
|
abort(403, "Can't unpin award pins!")
|
||||||
|
|
||||||
comment.stickied = None
|
comment.stickied = None
|
||||||
|
comment.stickied_utc = None
|
||||||
g.db.add(comment)
|
g.db.add(comment)
|
||||||
|
|
||||||
ma=ModAction(
|
ma=ModAction(
|
||||||
|
|
|
@ -533,6 +533,7 @@ def unpin_comment(cid, v):
|
||||||
abort(403, "You can only unpin comments you have pinned!")
|
abort(403, "You can only unpin comments you have pinned!")
|
||||||
|
|
||||||
comment.stickied = None
|
comment.stickied = None
|
||||||
|
comment.stickied_utc = None
|
||||||
g.db.add(comment)
|
g.db.add(comment)
|
||||||
|
|
||||||
if v.id != comment.author_id:
|
if v.id != comment.author_id:
|
||||||
|
|
|
@ -722,6 +722,7 @@ def delete_post_pid(pid, v):
|
||||||
p.deleted_utc = int(time.time())
|
p.deleted_utc = int(time.time())
|
||||||
p.is_pinned = False
|
p.is_pinned = False
|
||||||
p.stickied = None
|
p.stickied = None
|
||||||
|
p.stickied_utc = None
|
||||||
|
|
||||||
g.db.add(p)
|
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)
|
if not (comment.post.sub and v.mods(comment.post.sub)): abort(403)
|
||||||
|
|
||||||
comment.stickied = None
|
comment.stickied = None
|
||||||
|
comment.stickied_utc = None
|
||||||
g.db.add(comment)
|
g.db.add(comment)
|
||||||
|
|
||||||
ma = SubAction(
|
ma = SubAction(
|
||||||
|
|
Loading…
Reference in New Issue