From 5342ad2dd94110f8476b841c9c23a0ee3b29e203 Mon Sep 17 00:00:00 2001 From: Aevann1 Date: Thu, 9 Sep 2021 00:09:45 +0200 Subject: [PATCH] fd --- files/routes/comments.py | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/files/routes/comments.py b/files/routes/comments.py index f3f2397672..010cbae5a9 100644 --- a/files/routes/comments.py +++ b/files/routes/comments.py @@ -876,16 +876,8 @@ def toggle_comment_pin(cid, v): ) g.db.add(ma) - html=render_template( - "comments.html", - v=v, - comments=[comment], - render_replies=False, - ) - - html=str(BeautifulSoup(html, features="html.parser").find(id=f"comment-{comment.id}-only")) - - return html + if comment.is_pinned: return {"message": "Comment pinned!"} + else: return {"message": "Comment unpinned!"} @app.post("/save_comment/")