dont count author's own vote

master
Aevann 2024-04-21 22:07:16 +02:00
parent 3b01db711d
commit aece92f70b
2 changed files with 4 additions and 4 deletions

View File

@ -396,7 +396,7 @@ def delete_comment(cid, v):
c.deleted_utc = int(time.time())
g.db.add(c)
c.author.truescore -= c.upvotes + c.downvotes
c.author.truescore -= c.upvotes + c.downvotes - 1
g.db.add(c.author)
if c.pinned:
@ -435,7 +435,7 @@ def undelete_comment(cid, v):
c.deleted_utc = 0
g.db.add(c)
c.author.truescore += c.upvotes + c.downvotes
c.author.truescore += c.upvotes + c.downvotes - 1
g.db.add(c.author)
if not (c.parent_post in ADMIGGER_THREADS and c.level == 1):

View File

@ -760,7 +760,7 @@ def delete_post_pid(pid, v):
g.db.add(p)
p.author.truescore -= p.upvotes + p.downvotes
p.author.truescore -= p.upvotes + p.downvotes - 1
g.db.add(p.author)
cache.delete_memoized(frontlist)
@ -788,7 +788,7 @@ def undelete_post_pid(pid, v):
p.deleted_utc = 0
g.db.add(p)
p.author.truescore += p.upvotes + p.downvotes
p.author.truescore += p.upvotes + p.downvotes - 1
g.db.add(p.author)
cache.delete_memoized(frontlist)