From 0620c7a4beee57c89e009a5f173f40d1ade64ee8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9s=20Riquelme?= Date: Mon, 11 Jan 2021 00:35:16 -0300 Subject: [PATCH] fix(account): fix slurs validator triggering when no bad words list has been created --- src/account/validators.py | 1 + 1 file changed, 1 insertion(+) diff --git a/src/account/validators.py b/src/account/validators.py index d241ec4..bbee149 100644 --- a/src/account/validators.py +++ b/src/account/validators.py @@ -36,6 +36,7 @@ def generate_bad_words_regex(self): bad_list = f.readlines() except FileNotFoundError: self.regex = None + self.inverse_match = False return bad_list = [w.replace("\n", "").strip() for w in bad_list] self.regex = re.compile(formatted_regex.format("|".join(bad_list)), self.flags)