From e8b5ba6686b257049df0562e35aa149ff1b074cc Mon Sep 17 00:00:00 2001 From: Jeny Sadadia Date: Thu, 30 May 2024 18:25:53 +0530 Subject: [PATCH] api.main: fix POST `/user/update_password` endpoint Fix the below validation error while requesting user password update: ``` {"detail":"1 validation error for UserRead\nresponse\n none is not an allowed value (type=type_error.none.not_allowed)"} ``` The endpoint returns null on successful request even if response model is specified (and it's not None). Signed-off-by: Jeny Sadadia --- api/main.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/api/main.py b/api/main.py index b3eaf1da..9d241ed2 100644 --- a/api/main.py +++ b/api/main.py @@ -344,7 +344,7 @@ async def get_users(request: Request, return paginated_resp -@app.post("/user/update-password", response_model=UserRead, tags=["user"]) +@app.post("/user/update-password", tags=["user"]) async def update_password(request: Request, credentials: OAuth2PasswordRequestForm = Depends(), new_password: str = Form(None)):