document check_username()
This commit is contained in:
parent
cfee9fa428
commit
711d562af0
@ -179,7 +179,13 @@ def get_game(game_id: str) -> Union[Game, None]:
|
|||||||
else:
|
else:
|
||||||
return None
|
return None
|
||||||
|
|
||||||
def check_username(username):
|
def check_username(username: str) -> bool:
|
||||||
|
"""
|
||||||
|
Check if a username is valid using a set of rules
|
||||||
|
|
||||||
|
:param username: the username to check
|
||||||
|
:return: True or False depending on if the rules are respected
|
||||||
|
"""
|
||||||
if not username:
|
if not username:
|
||||||
return False
|
return False
|
||||||
if not username.isalnum():
|
if not username.isalnum():
|
||||||
|
Loading…
Reference in New Issue
Block a user