From a03d249a18fd36aafb9ca8ab1b4c45caaa0a37df Mon Sep 17 00:00:00 2001 From: rimu <3310831+rimu@users.noreply.github.com> Date: Mon, 9 Sep 2024 17:20:00 +1200 Subject: [PATCH] disallow spaces in user names #320 --- app/cli.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/cli.py b/app/cli.py index 00c87bf6..09ff05f5 100644 --- a/app/cli.py +++ b/app/cli.py @@ -148,8 +148,8 @@ 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.') + while '@' in user_name or ' ' in user_name: + print('User name cannot be an email address or have spaces.') user_name = input("Admin user name (ideally not 'admin'): ") verification_token = random_token(16) private_key, public_key = RsaKeys.generate_keypair()