gf
This commit is contained in:
parent
2b266c5512
commit
9647a01686
1 changed files with 6 additions and 4 deletions
|
@ -58,14 +58,16 @@ def post_pid_comment_cid(cid, pid=None, anything=None, v=None):
|
|||
# context improver
|
||||
try: context = int(request.args.get("context", 0))
|
||||
except: context = 0
|
||||
comment_info = comment
|
||||
while context > 0 and comment.level > 1:
|
||||
|
||||
parent = get_comment(c.parent_comment_id, v=v)
|
||||
|
||||
post.preloaded_comments += [parent]
|
||||
|
||||
c = parent
|
||||
comment = parent
|
||||
context -= 1
|
||||
top_comment = comment
|
||||
|
||||
if v: defaultsortingcomments = v.defaultsortingcomments
|
||||
else: defaultsortingcomments = "top"
|
||||
|
@ -168,10 +170,10 @@ def post_pid_comment_cid(cid, pid=None, anything=None, v=None):
|
|||
|
||||
post.tree_comments()
|
||||
|
||||
post.replies=[comment]
|
||||
post.replies=[top_comment]
|
||||
|
||||
if request.headers.get("Authorization"): return comment.json
|
||||
else: return post.rendered_page(v=v, sort=sort, comment=comment, comment_info=comment)
|
||||
if request.headers.get("Authorization"): return top_comment.json
|
||||
else: return post.rendered_page(v=v, sort=sort, comment=top_comment, comment_info=comment_info)
|
||||
|
||||
|
||||
@app.post("/comment")
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue