Skip to content

Commit

Permalink
api.main: fix POST /user/update_password endpoint
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
Jeny Sadadia authored and JenySadadia committed Jun 26, 2024
1 parent 16e81dc commit e8b5ba6
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion api/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)):
Expand Down

0 comments on commit e8b5ba6

Please sign in to comment.