We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 790d0ba commit a009075Copy full SHA for a009075
1 file changed
src/routers/dependencies.py
@@ -1,4 +1,4 @@
1
-from collections.abc import AsyncIterator
+from collections.abc import AsyncGenerator, AsyncIterator
2
from typing import Annotated
3
4
from fastapi import Depends
@@ -26,7 +26,7 @@ async def userdb_connection() -> AsyncIterator[AsyncConnection]:
26
async def fetch_user(
27
api_key: APIKey | None = None,
28
user_data: Annotated[AsyncConnection | None, Depends(userdb_connection)] = None,
29
-) -> AsyncIterator[User | None]:
+) -> AsyncGenerator[User | None]:
30
if not (api_key and user_data):
31
yield None
32
return
0 commit comments