From 29fa35dffe1d2383a5b6c8af2e5b7b808bf5da4a Mon Sep 17 00:00:00 2001 From: Sven Heidemann Date: Sun, 16 Oct 2022 21:16:04 +0200 Subject: [PATCH] Fixed update user #70 --- kdb-bot/src/bot_api/controller/auth_controller.py | 2 +- kdb-bot/src/bot_api/service/auth_service.py | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/kdb-bot/src/bot_api/controller/auth_controller.py b/kdb-bot/src/bot_api/controller/auth_controller.py index 5342df92c6..a23d490dff 100644 --- a/kdb-bot/src/bot_api/controller/auth_controller.py +++ b/kdb-bot/src/bot_api/controller/auth_controller.py @@ -112,7 +112,7 @@ class AuthController: @Route.authorize async def update_user_as_admin(self): dto: UpdateAuthUserDTO = JSONProcessor.process(UpdateAuthUserDTO, request.get_json(force=True, silent=True)) - await self._auth_service.update_user_async(dto) + await self._auth_service.update_user_as_admin_async(dto) return '', 200 @Route.post(f'{BasePath}/refresh') diff --git a/kdb-bot/src/bot_api/service/auth_service.py b/kdb-bot/src/bot_api/service/auth_service.py index 0a78a9c448..e1e4a2b943 100644 --- a/kdb-bot/src/bot_api/service/auth_service.py +++ b/kdb-bot/src/bot_api/service/auth_service.py @@ -273,6 +273,7 @@ class AuthService(AuthServiceABC): if user.auth_role == update_user_dto.auth_user.auth_role and user.auth_role != update_user_dto.new_auth_user.auth_role: user.auth_role = update_user_dto.new_auth_user.auth_role + self._auth_users.update_auth_user(user) self._db.save_changes() async def delete_auth_user_by_email_async(self, email: str):