document check_username()

This commit is contained in:
Thomas Rubini 2023-01-13 10:00:36 +01:00
parent cfee9fa428
commit 711d562af0
No known key found for this signature in database
GPG Key ID: C7D287C8C1CAC373

View File

@ -179,7 +179,13 @@ def get_game(game_id: str) -> Union[Game, None]:
else:
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:
return False
if not username.isalnum():