disallow spaces in user names #320

This commit is contained in:
rimu 2024-09-09 17:20:00 +12:00
parent 5cb0644b46
commit a03d249a18

View file

@ -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()