mirror of
https://github.com/affaan-m/ECC.git
synced 2026-10-26 18:35:05 +00:00
docs(fastapi-patterns): import Depends in the router example
The users router uses Depends() for OAuth2PasswordRequestForm but the
import line omits it, so the module raises NameError on import.
Regenerated pi/core with scripts/build-pi-core.js.
Signed-off-by: Wen <jwcastillo@gmail.com>
(cherry picked from commit d383fb57e9)
This commit is contained in:
2 files changed
+2
-2
No files matched your search
@@ -229,7 +229,7 @@ ActiveUserDep = Annotated[User, Depends(get_current_active_user)]
|
||||
```python
|
||||
# app/routers/users.py
|
||||
from typing import Annotated
|
||||
from fastapi import APIRouter, HTTPException, Query, status
|
||||
from fastapi import APIRouter, Depends, HTTPException, Query, status
|
||||
from fastapi.security import OAuth2PasswordRequestForm
|
||||
|
||||
from app.dependencies import ActiveUserDep, DbDep
|
||||
|
||||
@@ -229,7 +229,7 @@ ActiveUserDep = Annotated[User, Depends(get_current_active_user)]
|
||||
```python
|
||||
# app/routers/users.py
|
||||
from typing import Annotated
|
||||
from fastapi import APIRouter, HTTPException, Query, status
|
||||
from fastapi import APIRouter, Depends, HTTPException, Query, status
|
||||
from fastapi.security import OAuth2PasswordRequestForm
|
||||
|
||||
from app.dependencies import ActiveUserDep, DbDep
|
||||
|
||||
Reference in new issue
Block a user