From 0f6295802459025cbc5a6df7b06b4da54f4a03f0 Mon Sep 17 00:00:00 2001 From: Aevann Date: Sun, 12 Mar 2023 10:31:17 +0200 Subject: [PATCH] minor fix --- files/helpers/sanitize.py | 17 ++--------------- files/routes/users.py | 4 ++-- 2 files changed, 4 insertions(+), 17 deletions(-) diff --git a/files/helpers/sanitize.py b/files/helpers/sanitize.py index 2482a912f..3b4d04b7a 100644 --- a/files/helpers/sanitize.py +++ b/files/helpers/sanitize.py @@ -200,22 +200,9 @@ def execute_blackjack(v, target, body, type): send_repeatable_notification(id, f"Blackjack by @{v.username}: {extra_info}") return True -def execute_anti_grooming(v, c, u): - if 'discord' not in c.body and 'groomercord' not in c.body or v.shadowbanned: +def notify_jannies_of_grooming(v, c, u): + if 'discord' not in c.body and 'groomercord' not in c.body: return - - v.shadowbanned = AUTOJANNY_ID - - ma = ModAction( - kind="shadowban", - user_id=AUTOJANNY_ID, - target_user_id=v.id, - _note=f'reason: "Grooming @{u.username}"' - ) - g.db.add(ma) - - v.ban_reason = f"Grooming @{u.username}" - g.db.add(v) notified_ids = [x[0] for x in g.db.query(User.id).filter(User.admin_level >= PERMS['BLACKJACK_NOTIFICATIONS'])] diff --git a/files/routes/users.py b/files/routes/users.py index fe61c2bd2..05ee3cf52 100644 --- a/files/routes/users.py +++ b/files/routes/users.py @@ -536,7 +536,7 @@ def message2(v:User, username:str): g.db.flush() execute_blackjack(v, c, c.body_html, 'message') execute_under_siege(v, c, c.body_html, 'message') - execute_anti_grooming(v, c, user) + notify_jannies_of_grooming(v, c, user) c.top_comment_id = c.id if user.id not in bots: @@ -610,7 +610,7 @@ def messagereply(v:User): g.db.flush() execute_blackjack(v, c, c.body_html, 'message') execute_under_siege(v, c, c.body_html, 'message') - execute_anti_grooming(v, c, user) + notify_jannies_of_grooming(v, c, user) if user_id and user_id not in {v.id, MODMAIL_ID} | bots: notif = g.db.query(Notification).filter_by(comment_id=c.id, user_id=user_id).one_or_none()