From f754fdb2e88811b8eedf501b27dbecbbc74af210 Mon Sep 17 00:00:00 2001 From: rimu <3310831+rimu@users.noreply.github.com> Date: Mon, 4 Mar 2024 09:26:08 +1300 Subject: [PATCH] user name cannot be an email address fixes #70 --- app/cli.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/app/cli.py b/app/cli.py index 42c5a5f6..d6f90d9e 100644 --- a/app/cli.py +++ b/app/cli.py @@ -144,6 +144,9 @@ def register(app): user_name = input("Admin user name (ideally not 'admin'): ") email = input("Admin email address: ") password = input("Admin password: ") + while '@' in user_name: + print('User name cannot be an email address.') + user_name = input("Admin user name (ideally not 'admin'): ") verification_token = random_token(16) private_key, public_key = RsaKeys.generate_keypair() admin_user = User(user_name=user_name, title=user_name,