check if username is alphanumeric

This commit is contained in:
Thomas Rubini 2023-01-05 15:07:34 +01:00
parent f8783885f6
commit 39377d8c9b
No known key found for this signature in database
GPG Key ID: C7D287C8C1CAC373

View File

@ -1,6 +1,8 @@
def check_username(username):
if not username:
return False
if not username.isalnum():
return False
if not username == username.strip():
return False
if not len(username) < 16: