generate mod log item for removals

master
Aevann1 2022-12-19 23:48:50 +02:00
parent e4734f4ec4
commit e4d4c4798d
1 changed files with 15 additions and 1 deletions

View File

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