diff --git a/kdb-bot/src/bot/bot.json b/kdb-bot/src/bot/bot.json index bdbcc3b7..59f1bc69 100644 --- a/kdb-bot/src/bot/bot.json +++ b/kdb-bot/src/bot/bot.json @@ -18,7 +18,7 @@ "Dependencies": [ "cpl-core==2022.12.0", "cpl-translation==2022.10.0.post2", - "cpl-query==2022.12.1.post1", + "cpl-query==2022.12.2", "cpl-discord==2022.12.0", "Flask==2.2.2", "Flask-Classful==0.14.2", diff --git a/kdb-bot/src/bot_api/controller/auth_controller.py b/kdb-bot/src/bot_api/controller/auth_controller.py index d3eb3c3e..89eaa38b 100644 --- a/kdb-bot/src/bot_api/controller/auth_controller.py +++ b/kdb-bot/src/bot_api/controller/auth_controller.py @@ -46,14 +46,14 @@ class AuthController: @Route.authorize(role=AuthRoleEnum.admin) async def get_all_users(self) -> Response: result = await self._auth_service.get_all_auth_users_async() - return jsonify(result.select(lambda x: x.to_dict())) + return jsonify(result.select(lambda x: x.to_dict()).to_list()) @Route.post(f'{BasePath}/users/get/filtered') @Route.authorize(role=AuthRoleEnum.admin) async def get_filtered_users(self) -> Response: dto: AuthUserSelectCriteria = JSONProcessor.process(AuthUserSelectCriteria, request.get_json(force=True, silent=True)) result = await self._auth_service.get_filtered_auth_users_async(dto) - result.result = result.result.select(lambda x: x.to_dict()) + result.result = result.result.select(lambda x: x.to_dict()).to_list() return jsonify(result.to_dict()) @Route.get(f'{BasePath}/users/get/') diff --git a/kdb-bot/src/bot_api/controller/discord/server_controller.py b/kdb-bot/src/bot_api/controller/discord/server_controller.py index 1c362ab9..2a6f7c1d 100644 --- a/kdb-bot/src/bot_api/controller/discord/server_controller.py +++ b/kdb-bot/src/bot_api/controller/discord/server_controller.py @@ -40,14 +40,14 @@ class ServerController: @Route.authorize(role=AuthRoleEnum.admin) async def get_all_servers(self) -> Response: result = await self._discord_service.get_all_servers() - result = result.select(lambda x: x.to_dict()) + result = result.select(lambda x: x.to_dict()).to_list() return jsonify(result) @Route.get(f'{BasePath}/get/servers-by-user') @Route.authorize async def get_all_servers_by_user(self) -> Response: result = await self._discord_service.get_all_servers_by_user() - result = result.select(lambda x: x.to_dict()) + result = result.select(lambda x: x.to_dict()).to_list() return jsonify(result) @Route.post(f'{BasePath}/get/filtered') @@ -55,11 +55,11 @@ class ServerController: async def get_filtered_servers(self) -> Response: dto: ServerSelectCriteria = JSONProcessor.process(ServerSelectCriteria, request.get_json(force=True, silent=True)) result = await self._discord_service.get_filtered_servers_async(dto) - result.result = result.result.select(lambda x: x.to_dict()) + result.result = result.result.select(lambda x: x.to_dict()).to_list() return jsonify(result.to_dict()) @Route.get(f'{BasePath}/get/') @Route.authorize async def get_server_by_id(self, id: int) -> Response: - result = await self._discord_service.get_server_by_id_async(id) + result = await self._discord_service.get_server_by_id_async(id).to_list() return jsonify(result.to_dict()) diff --git a/kdb-bot/src/modules/level/level_seeder.py b/kdb-bot/src/modules/level/level_seeder.py index 2708324c..7dcd6118 100644 --- a/kdb-bot/src/modules/level/level_seeder.py +++ b/kdb-bot/src/modules/level/level_seeder.py @@ -88,7 +88,7 @@ class LevelSeeder(DataSeederABC): if levels.where(lambda l: l.name == role.name).count() == 0: continue - new_position = position_above_levels - (levels.index(levels.where(lambda l: l.name == role.name).single()) + 1) + new_position = position_above_levels - (levels.index_of(levels.where(lambda l: l.name == role.name).single()) + 1) if new_position <= 0: new_position = 1 try: