forked from sh-edraft.de/sh_discord_bot
Fixed update user #70
This commit is contained in:
parent
c5f371e0d5
commit
29fa35dffe
@ -112,7 +112,7 @@ class AuthController:
|
|||||||
@Route.authorize
|
@Route.authorize
|
||||||
async def update_user_as_admin(self):
|
async def update_user_as_admin(self):
|
||||||
dto: UpdateAuthUserDTO = JSONProcessor.process(UpdateAuthUserDTO, request.get_json(force=True, silent=True))
|
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
|
return '', 200
|
||||||
|
|
||||||
@Route.post(f'{BasePath}/refresh')
|
@Route.post(f'{BasePath}/refresh')
|
||||||
|
@ -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:
|
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
|
user.auth_role = update_user_dto.new_auth_user.auth_role
|
||||||
|
|
||||||
|
self._auth_users.update_auth_user(user)
|
||||||
self._db.save_changes()
|
self._db.save_changes()
|
||||||
|
|
||||||
async def delete_auth_user_by_email_async(self, email: str):
|
async def delete_auth_user_by_email_async(self, email: str):
|
||||||
|
Loading…
Reference in New Issue
Block a user