add exclude model for delete method

This commit is contained in:
Valentin CZERYBA 2023-10-14 18:33:05 +02:00
parent 803d0330a1
commit b2d5481e10

View File

@ -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): 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) user_repository = users.UserRepository(database=database.database)
current_user.disabled = True current_user.disabled = True