mirror of
https://gitlab.com/crafty-controller/crafty-4.git
synced 2024-08-30 18:23:09 +00:00
Add error for no user
This commit is contained in:
parent
49965bf31f
commit
d235d0b70b
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user