fix agendapostered wall comments

pull/48/head
Aevann1 2022-12-05 05:08:06 +02:00
parent 13a208ee88
commit 3971607aee
2 changed files with 3 additions and 3 deletions

View File

@ -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:

View File

@ -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!')