From cafe3c47d36caf403c28c8d22d41e33b9baeb437 Mon Sep 17 00:00:00 2001 From: Aevann1 Date: Sun, 18 Dec 2022 16:23:59 +0200 Subject: [PATCH] overwrite ban reason --- files/helpers/actions.py | 5 +++-- files/routes/routehelpers.py | 4 ++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/files/helpers/actions.py b/files/helpers/actions.py index eefecc79f..ccfe7b4f2 100644 --- a/files/helpers/actions.py +++ b/files/helpers/actions.py @@ -386,7 +386,7 @@ def execute_blackjack(v, target, body, type): if not blackjack or not body: return True if any(i in body.lower() for i in blackjack.split()): v.shadowbanned = AUTOJANNY_ID - if not v.is_banned: v.ban_reason = f"Blackjack" + v.ban_reason = f"Blackjack" g.db.add(v) notif = None extra_info = "unknown entity" @@ -469,7 +469,8 @@ def execute_under_siege(v:User, target:Optional[Union[Submission, Comment]], bod if not get_setting("under_siege"): return True if v.age < UNDER_SIEGE_AGE_THRESHOLD and not v.admin_level >= PERMS['SITE_BYPASS_UNDER_SIEGE_MODE']: v.shadowbanned = AUTOJANNY_ID - if not v.is_banned: v.ban_reason = f"Under Siege" + + v.ban_reason = f"Under Siege" v.is_muted = True g.db.add(v) t = time.strftime("%Y-%m-%d %H:%M:%S", time.gmtime(time.time())) diff --git a/files/routes/routehelpers.py b/files/routes/routehelpers.py index 71fa1ad08..32ea2996e 100644 --- a/files/routes/routehelpers.py +++ b/files/routes/routehelpers.py @@ -72,11 +72,11 @@ def check_for_alts(current:User, include_current_session=True): if u._alt_deleted: continue if u.shadowbanned: current.shadowbanned = u.shadowbanned - if not current.is_banned: current.ban_reason = u.ban_reason + current.ban_reason = u.ban_reason g.db.add(current) elif current.shadowbanned: u.shadowbanned = current.shadowbanned - if not u.is_banned: u.ban_reason = current.ban_reason + u.ban_reason = current.ban_reason g.db.add(u) def execute_shadowban_viewers_and_voters(v:Optional[User], target:Union[Submission, Comment]):