fix api comments (fixes #512)

This commit is contained in:
justcool393 2023-02-16 19:35:31 -06:00 committed by Ben Rog-Wilhelm
parent 50b6e06f62
commit a8013f1089

View file

@ -317,9 +317,7 @@ class Comment(Base):
'parent': self.parent_fullname
}
else:
data = self.json_raw
if self.level >= 2: data['parent_comment_id']= self.parent_comment_id
data['replies'] = [x.json_core for x in self.replies(None)]
@ -329,19 +327,10 @@ class Comment(Base):
@property
@lazy
def json(self):
data = self.json_core
if self.deleted_utc or self.is_banned:
return data
if self.deleted_utc or self.is_banned: return data
data["author"] = '👻' if self.ghost else self.author.json_core
data["post"] = self.post.json_core if self.post else ''
if self.level >= 2:
data["parent"]=self.parent.json_core
return data
def realbody(self, v):