Merge branch 'dev' into 'master'

Fix user reset password. Fix NL language

See merge request crafty-controller/crafty-4!335
This commit is contained in:
Andrew 2022-06-13 21:06:37 +00:00
commit 5022723895
2 changed files with 10 additions and 5 deletions

View File

@ -60,14 +60,16 @@ class MainPrompt(cmd.Cmd):
def do_set_passwd(self, line):
try:
username = str(line).lower()
username = line
# 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}")
Console.error(
f"No user found by the name of {username} this is case sensitive"
)
return False
except:
Console.error(f"User: {line} Not Found")

View File

@ -541,9 +541,12 @@ class ServerInstance:
f"Server {self.name} has crash detection enabled "
"- starting watcher task"
)
self.server_scheduler.add_job(
self.detect_crash, "interval", seconds=30, id=f"c_{self.server_id}"
)
try:
self.server_scheduler.add_job(
self.detect_crash, "interval", seconds=30, id=f"c_{self.server_id}"
)
except:
logger.info(f"Job with id c_{self.server_id} already running...")
def stop_threaded_server(self):
self.stop_server()