diff --git a/core/admin/mailu/utils.py b/core/admin/mailu/utils.py index 4c55e27d..f160fe3f 100644 --- a/core/admin/mailu/utils.py +++ b/core/admin/mailu/utils.py @@ -509,12 +509,12 @@ def gen_temp_token(email, session): return token def isBadOrPwned(form): - try: - if len(form.pw.data) < 8: - return "This password is too short." - breaches = int(form.pwned.data) - except ValueError: - breaches = -1 - if breaches > 0: - return f"This password appears in {breaches} data breaches! It is not unique; please change it." + try: + if len(form.pw.data) < 8: + return "This password is too short." + breaches = int(form.pwned.data) + except ValueError: + breaches = -1 + if breaches > 0: + return f"This password appears in {breaches} data breaches! It is not unique; please change it." return None