diff --git a/files/routes/comments.py b/files/routes/comments.py index 1baa1a92d..83fb97502 100644 --- a/files/routes/comments.py +++ b/files/routes/comments.py @@ -396,6 +396,9 @@ def delete_comment(cid, v): c.deleted_utc = int(time.time()) g.db.add(c) + c.author.truescore -= c.upvotes + c.downvotes + g.db.add(c.author) + if c.pinned: c.pinned = None c.pinned_utc = None @@ -432,6 +435,9 @@ def undelete_comment(cid, v): c.deleted_utc = 0 g.db.add(c) + c.author.truescore += c.upvotes + c.downvotes + g.db.add(c.author) + if not (c.parent_post in ADMIGGER_THREADS and c.level == 1): v.comment_count += 1 g.db.add(v) diff --git a/files/routes/posts.py b/files/routes/posts.py index cba171d5a..310e019e0 100644 --- a/files/routes/posts.py +++ b/files/routes/posts.py @@ -760,6 +760,9 @@ def delete_post_pid(pid, v): g.db.add(p) + p.author.truescore -= p.upvotes + p.downvotes + g.db.add(p.author) + cache.delete_memoized(frontlist) cache.delete_memoized(userpagelisting) @@ -785,6 +788,9 @@ def undelete_post_pid(pid, v): p.deleted_utc = 0 g.db.add(p) + p.author.truescore += p.upvotes + p.downvotes + g.db.add(p.author) + cache.delete_memoized(frontlist) cache.delete_memoized(userpagelisting)