fix api comments (fixes #512)
This commit is contained in:
parent
50b6e06f62
commit
a8013f1089
1 changed files with 9 additions and 20 deletions
|
@ -317,9 +317,7 @@ class Comment(Base):
|
||||||
'parent': self.parent_fullname
|
'parent': self.parent_fullname
|
||||||
}
|
}
|
||||||
else:
|
else:
|
||||||
|
|
||||||
data = self.json_raw
|
data = self.json_raw
|
||||||
|
|
||||||
if self.level >= 2: data['parent_comment_id']= self.parent_comment_id
|
if self.level >= 2: data['parent_comment_id']= self.parent_comment_id
|
||||||
|
|
||||||
data['replies'] = [x.json_core for x in self.replies(None)]
|
data['replies'] = [x.json_core for x in self.replies(None)]
|
||||||
|
@ -329,19 +327,10 @@ class Comment(Base):
|
||||||
@property
|
@property
|
||||||
@lazy
|
@lazy
|
||||||
def json(self):
|
def json(self):
|
||||||
|
|
||||||
data = self.json_core
|
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["author"] = '👻' if self.ghost else self.author.json_core
|
||||||
data["post"] = self.post.json_core if self.post else ''
|
data["post"] = self.post.json_core if self.post else ''
|
||||||
|
|
||||||
if self.level >= 2:
|
|
||||||
data["parent"]=self.parent.json_core
|
|
||||||
|
|
||||||
|
|
||||||
return data
|
return data
|
||||||
|
|
||||||
def realbody(self, v):
|
def realbody(self, v):
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue