This commit is contained in:
Aevann1 2022-01-22 12:14:15 +02:00
parent 13d2342b62
commit b4dc4e1679
8 changed files with 49 additions and 33 deletions

View file

@ -22,6 +22,7 @@ class Comment(Base):
created_utc = Column(Integer, default=0)
edited_utc = Column(Integer, default=0)
is_banned = Column(Boolean, default=False)
ghost = Column(Boolean)
bannedfor = Column(Boolean)
distinguish_level = Column(Integer, default=0)
deleted_utc = Column(Integer, default=0)
@ -224,7 +225,7 @@ class Comment(Base):
@property
@lazy
def author_name(self):
if self.award_count('ghosts') or self.post and self.post.award_count('ghosts'): return '👻'
if self.ghost: return '👻'
else: return self.author.username
@property
@ -310,7 +311,7 @@ class Comment(Base):
if self.deleted_utc or self.is_banned:
return data
data["author"]=self.author.json_core if self.author_name != '👻' else '👻'
data["author"]='👻' if self.ghost else self.author.json_core
data["post"]=self.post.json_core if self.post else ''
if self.level >= 2: