From 1e34625c1f00c0ca4d4435389309d8a6a4852d29 Mon Sep 17 00:00:00 2001 From: Aevann1 Date: Mon, 5 Dec 2022 04:08:24 +0200 Subject: [PATCH] fix editing wall comments --- files/routes/comments.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/files/routes/comments.py b/files/routes/comments.py index 217eae319..defe72ae2 100644 --- a/files/routes/comments.py +++ b/files/routes/comments.py @@ -561,7 +561,8 @@ def edit_comment(cid, v): abort(403, "You can't edit comments older than 1 week!") if c.author_id != v.id: abort(403) - if not c.post: abort(403) + if not c.parent_submission and not c.wall_user_id: + abort(403) body = sanitize_raw_body(request.values.get("body", ""), False) @@ -604,7 +605,7 @@ def edit_comment(cid, v): execute_blackjack(v, c, c.body, "comment") execute_under_siege(v, c, c.body, "comment") - if c.post.id not in ADMIGGER_THREADS and v.agendaposter and not v.marseyawarded and AGENDAPOSTER_PHRASE not in c.body.lower() and c.post.sub != 'chudrama': + if not (c.parent_submission and c.post.id in ADMIGGER_THREADS) and v.agendaposter and not v.marseyawarded and AGENDAPOSTER_PHRASE not in c.body.lower() and c.post.sub != 'chudrama': abort(403, f'You have to include "{AGENDAPOSTER_PHRASE}" in your comment!')