vote realness is in user model
parent
81b2e04ff7
commit
941b5fa82d
|
@ -289,6 +289,14 @@ class User(Base):
|
|||
if self.bite: return "565656"
|
||||
return self.namecolor
|
||||
|
||||
@property
|
||||
@lazy
|
||||
def is_votes_real(self):
|
||||
if self.is_suspended_permanently or self.shadowbanned: return False
|
||||
if self.agendaposter: return False
|
||||
if self.profile_url.startswith('/e/') and not self.customtitle and self.namecolor == DEFAULT_COLOR: return False
|
||||
return True
|
||||
|
||||
@lazy
|
||||
def mods(self, sub):
|
||||
if self.is_suspended_permanently or self.shadowbanned: return False
|
||||
|
|
|
@ -98,9 +98,7 @@ def vote_post_comment(target_id, new, v, cls, vote_cls):
|
|||
target.author.truecoins += coin_delta
|
||||
g.db.add(target.author)
|
||||
|
||||
if new == 1 and (v.agendaposter or v.shadowbanned or (v.is_banned and not v.unban_utc) or (v.profile_url.startswith('/e/') and not v.customtitle and v.namecolor == DEFAULT_COLOR)): real = False
|
||||
else: real = True
|
||||
|
||||
real = new != 1 or v.is_votes_real
|
||||
vote = None
|
||||
if vote_cls == Vote:
|
||||
vote = Vote(user_id=v.id,
|
||||
|
|
Loading…
Reference in New Issue