diff --git a/mo/users.py b/mo/users.py index d3de7e54f5887a6aed9e883e48da54a905ad26bb..bbfedf7f79469253d0576da0c69b93f68e1b4efe 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áč')