From b130139f3d51c78d3b9a5f7c61d7b5bc0434043f Mon Sep 17 00:00:00 2001 From: Aevann1 Date: Tue, 15 Nov 2022 16:55:21 +0200 Subject: [PATCH] sneed --- files/classes/user.py | 5 +++++ files/routes/votes.py | 3 +++ 2 files changed, 8 insertions(+) diff --git a/files/classes/user.py b/files/classes/user.py index 0453d94d1..5baf2e5de 100644 --- a/files/classes/user.py +++ b/files/classes/user.py @@ -743,6 +743,11 @@ class User(Base): return output + @property + @lazy + def alt_ids(self): + return [x.id for x in self.alts] + @property @lazy def moderated_subs(self): diff --git a/files/routes/votes.py b/files/routes/votes.py index e681acb24..d9ab61768 100644 --- a/files/routes/votes.py +++ b/files/routes/votes.py @@ -61,6 +61,9 @@ def vote_post_comment(target_id, new, v, cls, vote_cls): if v.id == target.author.id: coin_delta = 0 + if target.author.id in v.alt_ids or v.id in target.author.alt_ids: + coin_delta = -1 + coin_mult = 1 g.db.flush()