From dc02c114d7d14474aa18229ec4de978a9804073c Mon Sep 17 00:00:00 2001 From: Aevann1 Date: Thu, 3 Mar 2022 18:06:35 +0200 Subject: [PATCH] ah --- files/routes/posts.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/files/routes/posts.py b/files/routes/posts.py index c3fc6fc17..fb681c3bc 100644 --- a/files/routes/posts.py +++ b/files/routes/posts.py @@ -392,14 +392,16 @@ def viewmore(v, pid, sort, offset): else: offset += 1 comments = comments2 - return render_template("comments.html", v=v, comments=comments, ids=list(ids), render_replies=True, pid=pid, sort=sort, offset=offset, ajax=True) + return render_template("comments.html", v=v, comments=comments, ids=list(ids), render_replies=True, p=post, pid=pid, sort=sort, offset=offset, ajax=True) @app.get("/morecomments/") @limiter.limit("1/second;30/minute;200/hour;1000/day") @auth_desired def morecomments(v, cid): - tcid = g.db.query(Comment.top_comment_id).filter_by(id=cid).one_or_none()[0] + top_comment = g.db.query(Comment).filter_by(id=cid).one_or_none() + p = top_comment.post + tcid = top_comment.id if v: votes = g.db.query(CommentVote).filter_by(user_id=v.id).subquery() @@ -441,7 +443,7 @@ def morecomments(v, cid): c = g.db.query(Comment).filter_by(id=cid).one_or_none() comments = c.replies - return render_template("comments.html", v=v, comments=comments, render_replies=True, ajax=True) + return render_template("comments.html", v=v, comments=comments, p=p, render_replies=True, ajax=True) @app.post("/edit_post/") @limiter.limit("1/second;30/minute;200/hour;1000/day")