Fix geo_re_resolve async mocks and mark tasks complete
This commit is contained in:
@@ -7,7 +7,7 @@ directly — to keep coupling explicit and testable.
|
||||
"""
|
||||
|
||||
import time
|
||||
from typing import Annotated
|
||||
from typing import Annotated, Protocol, cast
|
||||
|
||||
import aiosqlite
|
||||
import structlog
|
||||
@@ -19,6 +19,13 @@ from app.utils.time_utils import utc_now
|
||||
|
||||
log: structlog.stdlib.BoundLogger = structlog.get_logger()
|
||||
|
||||
|
||||
class AppState(Protocol):
|
||||
"""Partial view of the FastAPI application state used by dependencies."""
|
||||
|
||||
settings: Settings
|
||||
|
||||
|
||||
_COOKIE_NAME = "bangui_session"
|
||||
|
||||
# ---------------------------------------------------------------------------
|
||||
@@ -85,7 +92,8 @@ async def get_settings(request: Request) -> Settings:
|
||||
Returns:
|
||||
The application settings loaded at startup.
|
||||
"""
|
||||
return request.app.state.settings # type: ignore[no-any-return]
|
||||
state = cast(AppState, request.app.state)
|
||||
return state.settings
|
||||
|
||||
|
||||
async def require_auth(
|
||||
|
||||
Reference in New Issue
Block a user