From 3971607aee18a1421fd077c761e479294d84071f Mon Sep 17 00:00:00 2001 From: Aevann1 Date: Mon, 5 Dec 2022 05:08:06 +0200 Subject: [PATCH] fix agendapostered wall comments --- files/routes/admin.py | 2 +- files/routes/comments.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/files/routes/admin.py b/files/routes/admin.py index 995409e06..8fd8d2855 100644 --- a/files/routes/admin.py +++ b/files/routes/admin.py @@ -1360,7 +1360,7 @@ def remove_comment(c_id, v): def approve_comment(c_id, v): comment = get_comment(c_id) - if comment.author.id == v.id and comment.author.agendaposter and AGENDAPOSTER_PHRASE not in comment.body.lower() and comment.post.sub != 'chudrama': + if comment.author.id == v.id and comment.author.agendaposter and AGENDAPOSTER_PHRASE not in comment.body.lower() and not (comment.parent_submission and comment.post.sub == 'chudrama'): abort(400, "You can't bypass the chud award!") if comment.is_banned: diff --git a/files/routes/comments.py b/files/routes/comments.py index da4cffe05..70cd11d07 100644 --- a/files/routes/comments.py +++ b/files/routes/comments.py @@ -590,7 +590,7 @@ def edit_comment(cid, v): if v.marsify: body_for_sanitize = marsify(body_for_sanitize) - torture = (v.agendaposter and not v.marseyawarded and c.post.sub != 'chudrama') + torture = (v.agendaposter and not v.marseyawarded and not (c.parent_submission and c.post.sub == 'chudrama')) body_html = sanitize(body_for_sanitize, golden=False, limit_pings=5, torture=torture) @@ -605,7 +605,7 @@ def edit_comment(cid, v): execute_blackjack(v, c, c.body, "comment") execute_under_siege(v, c, c.body, "comment") - 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': + 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 not (c.parent_submission and c.post.sub == 'chudrama'): abort(403, f'You have to include "{AGENDAPOSTER_PHRASE}" in your comment!')