diff --git a/app/classes/shared/models.py b/app/classes/shared/models.py index a5003e43..6fb6d6ff 100644 --- a/app/classes/shared/models.py +++ b/app/classes/shared/models.py @@ -569,6 +569,11 @@ class db_shortcuts: #logger.debug("user: ({}) {}".format(user_id, user)) return user + @staticmethod + def add_user_server(server_id, user_id): + servers = User_Servers.insert({User_Servers.server_id: server_id, User_Servers.user_id: user_id}).execute() + return servers + @staticmethod def user_query(user_id): diff --git a/app/classes/web/server_handler.py b/app/classes/web/server_handler.py index 788748ad..da774d15 100644 --- a/app/classes/web/server_handler.py +++ b/app/classes/web/server_handler.py @@ -201,6 +201,7 @@ class ServerHandler(BaseHandler): server_type, server_version = server_parts # todo: add server type check here and call the correct server add functions if not a jar new_server_id = self.controller.create_jar_server(server_type, server_version, server_name, min_mem, max_mem, port) + db_helper.add_user_server(new_server_id, exec_user_id) db_helper.add_to_audit_log(exec_user_data['user_id'], "created a {} {} server named \"{}\"".format(server_version, str(server_type).capitalize(), server_name), # Example: Admin created a 1.16.5 Bukkit server named "survival" new_server_id,