fix server deleting function due to type error after JWT merge.

This commit is contained in:
Andrew 2022-01-19 18:28:08 -05:00
parent 285a4ff9b4
commit 2f3110b107
2 changed files with 4 additions and 4 deletions

View File

@ -200,7 +200,7 @@ class Controller:
def get_server_data(self, server_id: str):
for s in self.servers_list:
if s['server_id'] == server_id:
if str(s['server_id']) == str(server_id):
return s['server_data_obj']
logger.warning("Unable to find server object for server id {}".format(server_id))
@ -450,7 +450,7 @@ class Controller:
for s in self.servers_list:
# if this is the droid... im mean server we are looking for...
if s['server_id'] == server_id:
if str(s['server_id']) == str(server_id):
server_data = self.get_server_data(server_id)
server_name = server_data['server_name']
backup_dir = self.servers.get_server_data_by_id(server_id)['backup_path']

View File

@ -427,7 +427,7 @@ class AjaxHandler(BaseHandler):
server_data = self.controller.get_server_data(server_id)
server_name = server_data['server_name']
self.controller.management.add_to_audit_log(exec_user_id,
self.controller.management.add_to_audit_log(exec_user['user_id'],
"Deleted server {} named {}".format(server_id, server_name),
server_id,
self.get_remote_ip())
@ -447,7 +447,7 @@ class AjaxHandler(BaseHandler):
server_data = self.controller.get_server_data(server_id)
server_name = server_data['server_name']
self.controller.management.add_to_audit_log(exec_user_id,
self.controller.management.add_to_audit_log(exec_user['user_id'],
"Deleted server {} named {}".format(server_id, server_name),
server_id,
self.get_remote_ip())