remotes/1693045480750635534/spooky-22
Aevann1 2021-08-08 01:11:49 +02:00
parent 50976dcc5f
commit c4154ffa96
3 changed files with 6 additions and 8 deletions

View File

@ -190,6 +190,7 @@ def get_comment(i, v=None, graceful=False, **kwargs):
vt = g.db.query(CommentVote).filter_by(user_id=v.id, comment_id=Comment.id).first()
comment._is_blocking = block and block.user_id == v.id
comment._is_blocked = block and block.target_id == v.id
print(vt.vote_type)
comment.voted = vt.vote_type if vt else 0
else:

View File

@ -58,8 +58,6 @@ 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
c = comment
while context > 0 and c.level > 1:
parent = get_comment(c.parent_comment_id, v=v)
@ -68,7 +66,6 @@ def post_pid_comment_cid(cid, pid=None, anything=None, v=None):
c = parent
context -= 1
top_comment = c
if v: defaultsortingcomments = v.defaultsortingcomments
else: defaultsortingcomments = "top"
@ -171,10 +168,10 @@ def post_pid_comment_cid(cid, pid=None, anything=None, v=None):
post.tree_comments()
post.replies=[top_comment]
post.replies=[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)
if request.headers.get("Authorization"): return comment.json
else: return post.rendered_page(v=v, sort=sort, comment=comment, comment_info=comment)
@app.post("/comment")

View File

@ -20,8 +20,8 @@
<p><a href="{{thing.permalink}}">{{thing.permalink}}</a></p>
<p><b>Author:</b> <a href="{{thing.author.url}}">@{{thing.author.username}}</a></p>
<p><b>Author Created At:</b> {{thing.author.created_utc}} ({{thing.author.created_datetime}})</p>
<p><preb>Upvotes: </pre>{{ups | length}}</p>
<p><pre>Downvotes: </pre>{{downs | length}}</p>
<p><b>Upvotes: </b>{{ups | length}}</p>
<p><b>Downvotes: </b>{{downs | length}}</p>
<h2>Upvotes</h2>
<table class="table table-striped mb-5">