diff --git a/app/routers/users.py b/app/routers/users.py index 515c710..23f6ffb 100644 --- a/app/routers/users.py +++ b/app/routers/users.py @@ -146,7 +146,7 @@ async def update_users_me(current_user: Annotated[users.User, Depends(users_toke return current_user @router.put("/users", tags=["users"], response_model=users.User, status_code=status.HTTP_200_OK) -async def update_users_id(authorize: Annotated[bool, Depends(permissions_checker.PermissionChecker(roles=["Admin"]))], userSingle: users.UserIn | None = None): +async def update_users_id(authorize: Annotated[bool, Depends(permissions_checker.PermissionChecker(roles=["Admin"]))], userSingle: users.UserIn | None = None, response: Response = Response): if userSingle is None: raise HTTPException( status_code=status.HTTP_400_BAD_REQUEST, @@ -156,7 +156,7 @@ async def update_users_id(authorize: Annotated[bool, Depends(permissions_checker user = user_repository.find_one_by({"username": {'$eq': userSingle.username}}) if user is None: - Response.status_code = status.HTTP_201_CREATED + response.status_code = status.HTTP_201_CREATED user = users.User(username=userSingle.username, password=users_token.get_password_hash(userSingle.password), email=userSingle.email) user.username = userSingle.username user.password = users_token.get_password_hash(userSingle.password)