From 8d45cf9267badbdf0aeb5b3e8e9b6717e30ed503 Mon Sep 17 00:00:00 2001 From: Aevann Date: Mon, 21 Oct 2024 23:28:11 +0300 Subject: [PATCH] failsafe against overwriting permabans --- files/classes/user.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/files/classes/user.py b/files/classes/user.py index dfb4e6b94..4eceb47ab 100644 --- a/files/classes/user.py +++ b/files/classes/user.py @@ -1152,6 +1152,9 @@ class User(Base): def ban(self, admin=None, reason=None, days=0.0, modlog=True): + if self.is_permabanned: + return + if len(reason) > BAN_REASON_HTML_LENGTH_LIMIT: stop(400, "Rendered ban reason is too long!")