Fix /comment JSON response (#167)
Since `replies` is no longer added to the response, returning the JSON for the top level comment makes it impossible to get the JSON for a reply.
Btw - you might want to remove the `author` field [here](60b5b33a79/files/classes/comment.py (L308)
). It attaches the full user bio and badge list to every comment, which turns something like `GET https://rdrama.net/post/18459` into a 21MB response. `author_name` is pretty much all anyone needs anyway
Co-authored-by: float-trip <float-trip@fsdfsd.net>
Reviewed-on: #167
Co-authored-by: float-trip <float-trip@noreply.fsdfsd.net>
Co-committed-by: float-trip <float-trip@noreply.fsdfsd.net>
pull/168/head
parent
15e445b01b
commit
041481f2b6
|
@ -75,7 +75,7 @@ def post_pid_comment_cid(cid, pid=None, anything=None, v=None, sub=None):
|
|||
execute_shadowban_viewers_and_voters(v, post)
|
||||
execute_shadowban_viewers_and_voters(v, comment)
|
||||
|
||||
if v and v.client: return top_comment.json
|
||||
if v and v.client: return comment.json
|
||||
else:
|
||||
if post.is_banned and not (v and (v.admin_level >= PERMS['POST_COMMENT_MODERATION'] or post.author_id == v.id)): template = "post_banned.html"
|
||||
else: template = "post.html"
|
||||
|
|
Loading…
Reference in New Issue