Add error for no user

This commit is contained in:
amcmanu3 2022-05-18 17:37:07 -04:00
parent 49965bf31f
commit d235d0b70b

View File

@ -56,7 +56,14 @@ class MainPrompt(cmd.Cmd):
try:
username = str(line).lower()
# If no user is found it returns None
user_id = self.controller.users.get_id_by_name(username)
if not username:
Console.error("You must enter a username. Ex: `set_passwd admin'")
return False
if not user_id:
Console.error(f"No user found by the name of {username}")
return False
except:
Console.error(f"User: {line} Not Found")
return False