From b2d5481e10b01fccb7fd84a531c1667154bbe154 Mon Sep 17 00:00:00 2001 From: Valentin CZERYBA Date: Sat, 14 Oct 2023 18:33:05 +0200 Subject: [PATCH] add exclude model for delete method --- app/routers/users.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/routers/users.py b/app/routers/users.py index d924877..2b69f95 100644 --- a/app/routers/users.py +++ b/app/routers/users.py @@ -56,7 +56,7 @@ async def read_users_id(item_id : str, authorize: Annotated[bool, Depends(permis -@router.delete("/users/me",tags=["users"]) +@router.delete("/users/me",tags=["users"], response_model=users.User, response_model_exclude=["id", "password", "roles", "disabled"]) async def read_users_me(current_user: Annotated[users.User, Depends(users_token.get_current_active_user)], authorize: Annotated[bool, Depends(permissions_checker.PermissionChecker(roles=["Admin", "User"]))], remove: bool = False): user_repository = users.UserRepository(database=database.database) current_user.disabled = True