From 75da44fd989da833691509572839fc1921392958 Mon Sep 17 00:00:00 2001 From: TLSM Date: Thu, 13 Jul 2023 01:40:23 -0400 Subject: [PATCH] Freshen branch, fix commenting Handle a couple places with `t3_` that persisted from code movement. on master after time of branch. Then, fix commenting, which used inaccurate fullname parsing logic. --- files/routes/comments.py | 5 ++--- files/templates/component/comment/replybox_comment.html | 4 ++-- files/templates/component/comment/replybox_message.html | 2 +- 3 files changed, 5 insertions(+), 6 deletions(-) diff --git a/files/routes/comments.py b/files/routes/comments.py index 399579c97..82a8f0b88 100644 --- a/files/routes/comments.py +++ b/files/routes/comments.py @@ -111,16 +111,15 @@ def api_comment(v): parent_fullname = request.values.get("parent_fullname", "").strip() if len(parent_fullname) < 4: abort(400) - id = parent_fullname[3:] parent = None parent_post = None parent_comment_id = None if parent_fullname.startswith("post_"): - parent = get_post(id, v=v) + parent = get_post(parent_fullname.split("post_")[1], v=v) parent_post = parent elif parent_fullname.startswith("comment_"): - parent = get_comment(id, v=v) + parent = get_comment(parent_fullname.split("comment_")[1], v=v) parent_post = get_post(parent.parent_submission, v=v) if parent.parent_submission else None parent_comment_id = parent.id else: abort(400) diff --git a/files/templates/component/comment/replybox_comment.html b/files/templates/component/comment/replybox_comment.html index 6f9577636..9e5babedc 100644 --- a/files/templates/component/comment/replybox_comment.html +++ b/files/templates/component/comment/replybox_comment.html @@ -1,10 +1,10 @@