From e4d4c4798df87835e1ddc8f973fc57368fb1d862 Mon Sep 17 00:00:00 2001 From: Aevann1 Date: Mon, 19 Dec 2022 23:48:50 +0200 Subject: [PATCH] generate mod log item for removals --- files/helpers/actions.py | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/files/helpers/actions.py b/files/helpers/actions.py index 4f489595d..bb19c8a75 100644 --- a/files/helpers/actions.py +++ b/files/helpers/actions.py @@ -413,8 +413,22 @@ def execute_blackjack(v, target, body, type): v.ban_reason = "Blackjack" g.db.add(v) - elif hasattr(target, 'is_banned'): + elif type == 'submission': target.is_banned = True + ma = ModAction( + kind="ban_post", + user_id=AUTOJANNY_ID, + _note='reason: "Blackjack"' + ) + g.db.add(ma) + elif type in ('comment', 'message', 'modmail'): + target.is_banned = True + ma = ModAction( + kind="ban_comment", + user_id=AUTOJANNY_ID, + _note='reason: "Blackjack"' + ) + g.db.add(ma) if type == 'submission': extra_info = target.permalink