Fix: Mod-only information leaked via the API. (#696)
This commit is contained in:
parent
41497958b6
commit
75edfe8b31
3 changed files with 10 additions and 15 deletions
|
@ -213,9 +213,6 @@ class Comment(CreatedBase):
|
|||
@property
|
||||
@lazy
|
||||
def json_raw(self):
|
||||
flags = {}
|
||||
for f in self.flags(None): flags[f.user.username] = f.reason
|
||||
|
||||
data= {
|
||||
'id': self.id,
|
||||
'level': self.level,
|
||||
|
@ -230,12 +227,13 @@ class Comment(CreatedBase):
|
|||
'is_pinned': self.is_pinned,
|
||||
'distinguish_level': self.distinguish_level,
|
||||
'post_id': self.post.id if self.post else 0,
|
||||
'score': self.score,
|
||||
'upvotes': self.upvotes,
|
||||
'downvotes': self.downvotes,
|
||||
'is_bot': self.is_bot,
|
||||
'flags': flags,
|
||||
}
|
||||
|
||||
if not self.should_hide_score:
|
||||
data['score'] = self.score
|
||||
data['upvotes'] = self.upvotes
|
||||
data['downvotes'] = self.downvotes
|
||||
|
||||
return data
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue