From 9e12d84ba0de3029a3d30fd96020f97ea2c57d2e Mon Sep 17 00:00:00 2001 From: Sven Heidemann Date: Tue, 3 Oct 2023 10:09:10 +0200 Subject: [PATCH] Fixed errors #393 --- kdb-bot/src/bot_core/service/config_service.py | 4 ---- kdb-bot/src/bot_graphql/mutations/server_config_mutation.py | 4 ---- .../src/bot_graphql/mutations/technician_config_mutation.py | 4 ---- kdb-bot/src/modules/boot_log/boot_log_on_ready_event.py | 2 +- 4 files changed, 1 insertion(+), 13 deletions(-) diff --git a/kdb-bot/src/bot_core/service/config_service.py b/kdb-bot/src/bot_core/service/config_service.py index 2b9d9196..c9022056 100644 --- a/kdb-bot/src/bot_core/service/config_service.py +++ b/kdb-bot/src/bot_core/service/config_service.py @@ -8,7 +8,6 @@ from bot_data.model.server import Server from bot_data.model.technician_config import TechnicianConfig from bot_data.service.server_config_seeder import ServerConfigSeeder from bot_data.service.technician_config_seeder import TechnicianConfigSeeder -from modules.permission.abc.permission_service_abc import PermissionServiceABC class ConfigService: @@ -45,6 +44,3 @@ class ConfigService: self._config.add_configuration( f"{type(server_config).__name__}_{server_config.server.discord_id}", server_config ) - - permissions: PermissionServiceABC = self._services.get_service(PermissionServiceABC) - permissions.on_ready() diff --git a/kdb-bot/src/bot_graphql/mutations/server_config_mutation.py b/kdb-bot/src/bot_graphql/mutations/server_config_mutation.py index 1c4d4d5e..044ec3be 100644 --- a/kdb-bot/src/bot_graphql/mutations/server_config_mutation.py +++ b/kdb-bot/src/bot_graphql/mutations/server_config_mutation.py @@ -13,7 +13,6 @@ from bot_data.model.server_team_role_ids_config import ServerTeamRoleIdsConfig from bot_data.model.team_member_type_enum import TeamMemberTypeEnum from bot_data.model.user_role_enum import UserRoleEnum from bot_graphql.abc.query_abc import QueryABC -from modules.permission.abc.permission_service_abc import PermissionServiceABC class ServerConfigMutation(QueryABC): @@ -25,7 +24,6 @@ class ServerConfigMutation(QueryABC): server_configs: ServerConfigRepositoryABC, db: DatabaseContextABC, config_service: ConfigService, - permissions: PermissionServiceABC, ): QueryABC.__init__(self, "ServerConfigMutation") @@ -35,7 +33,6 @@ class ServerConfigMutation(QueryABC): self._server_configs = server_configs self._db = db self._config_service = config_service - self._permissions = permissions self.set_field("updateServerConfig", self.resolve_update_server_config) @@ -183,4 +180,3 @@ class ServerConfigMutation(QueryABC): self._server_configs.add_server_team_role_id_config(role_id) self._bot.loop.create_task(self._config_service.reload_server_config(new_config.server)) - self._permissions.on_ready() diff --git a/kdb-bot/src/bot_graphql/mutations/technician_config_mutation.py b/kdb-bot/src/bot_graphql/mutations/technician_config_mutation.py index 5af875ee..0fa5318a 100644 --- a/kdb-bot/src/bot_graphql/mutations/technician_config_mutation.py +++ b/kdb-bot/src/bot_graphql/mutations/technician_config_mutation.py @@ -12,7 +12,6 @@ from bot_data.model.technician_id_config import TechnicianIdConfig from bot_data.model.technician_ping_url_config import TechnicianPingUrlConfig from bot_data.model.user_role_enum import UserRoleEnum from bot_graphql.abc.query_abc import QueryABC -from modules.permission.abc.permission_service_abc import PermissionServiceABC class TechnicianConfigMutation(QueryABC): @@ -23,7 +22,6 @@ class TechnicianConfigMutation(QueryABC): servers: ServerRepositoryABC, technician_configs: TechnicianConfigRepositoryABC, db: DatabaseContextABC, - permissions: PermissionServiceABC, config_service: ConfigService, ): QueryABC.__init__(self, "TechnicianConfigMutation") @@ -33,7 +31,6 @@ class TechnicianConfigMutation(QueryABC): self._servers = servers self._technician_configs = technician_configs self._db = db - self._permissions = permissions self._config_service = config_service self.set_field("updateTechnicianConfig", self.resolve_update_technician_config) @@ -114,4 +111,3 @@ class TechnicianConfigMutation(QueryABC): self._technician_configs.add_technician_id_config(TechnicianIdConfig(technician_id)) self._bot.loop.create_task(self._config_service.reload_technician_config()) - self._permissions.on_ready() diff --git a/kdb-bot/src/modules/boot_log/boot_log_on_ready_event.py b/kdb-bot/src/modules/boot_log/boot_log_on_ready_event.py index 1e2e5a52..4c8aeec7 100644 --- a/kdb-bot/src/modules/boot_log/boot_log_on_ready_event.py +++ b/kdb-bot/src/modules/boot_log/boot_log_on_ready_event.py @@ -67,7 +67,7 @@ class BootLogOnReadyEvent(OnReadyABC): server_config: ServerConfig = self._config.get_configuration(f"ServerConfig_{g.id}") if server_config is None: - self._logger.error(__name__, f"Config {type(self).__name__}_{g.id} not found!") + self._logger.error(__name__, f"Config ServerConfig_{g.id} not found!") return if not FeatureFlagsSettings.get_flag_from_dict(