From cc985b72498f22a01f070fd0d8a2ade2666ce3b2 Mon Sep 17 00:00:00 2001 From: Martin Mares <mj@ucw.cz> Date: Sat, 18 Mar 2023 22:55:27 +0100 Subject: [PATCH] =?UTF-8?q?I=20pro=20"cokoliv@nomail"=20generujeme=20unik?= =?UTF-8?q?=C3=A1tn=C3=AD=20adresu.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Kompatibilita s videonávodem. --- mo/users.py | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/mo/users.py b/mo/users.py index d3de7e54..bbfedf7f 100644 --- a/mo/users.py +++ b/mo/users.py @@ -295,10 +295,7 @@ def email_check_domain(domain: str): def normalize_email(addr: str, check_existence: bool = False, make_unique_nomail: bool = False) -> str: if make_unique_nomail and addr.endswith('@nomail'): - if addr == '@nomail': - addr = base64.b32encode(secrets.token_bytes(10)).decode('US-ASCII').lower() + '@nomail' - else: - raise mo.CheckError('Adresa @nomail nesmí obsahovat jméno uživatele před zavináčem') + addr = base64.b32encode(secrets.token_bytes(10)).decode('US-ASCII').lower() + '@nomail' if '@' not in addr: raise mo.CheckError('V e-mailové adrese chybí zavináč') -- GitLab