From fb41bc244388ba75cefa2d81d356e5ee25b1b45a Mon Sep 17 00:00:00 2001 From: amcmanu3 Date: Thu, 30 Nov 2023 01:05:00 -0500 Subject: [PATCH] Prevent stack for general user on boot --- app/classes/web/panel_handler.py | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/app/classes/web/panel_handler.py b/app/classes/web/panel_handler.py index e285d4e5..8ac827c3 100644 --- a/app/classes/web/panel_handler.py +++ b/app/classes/web/panel_handler.py @@ -210,6 +210,8 @@ class PanelHandler(BaseHandler): error = self.get_argument("error", "WTF Error!") template = "panel/denied.html" + if self.helper.crafty_starting: + page = "loading" now = time.time() formatted_time = str( @@ -243,9 +245,13 @@ class PanelHandler(BaseHandler): for r in exec_user["roles"]: role = self.controller.roles.get_role(r) exec_user_role.add(role["role_name"]) - defined_servers = self.controller.servers.get_authorized_servers( - exec_user["user_id"] - ) + # get_auth_servers will throw an exception if run while Crafty is starting + if not self.helper.crafty_starting: + defined_servers = self.controller.servers.get_authorized_servers( + exec_user["user_id"] + ) + else: + defined_servers = [] user_order = self.controller.users.get_user_by_id(exec_user["user_id"]) user_order = user_order["server_order"].split(",")