fix linter errors

This commit is contained in:
Илья Глазунов 2025-12-03 12:24:41 +03:00
parent 40e39efa37
commit 3e2704f870

View File

@ -17,7 +17,7 @@ logger = get_logger(__name__)
class ASGIAppLoader:
def __init__(self):
def __init__(self) -> None:
self._apps: Dict[str, ASGIApp] = {}
self._wsgi_adapters: Dict[str, ASGIApp] = {}
@ -59,7 +59,7 @@ class ASGIAppLoader:
logger.info(f"Wrapped WSGI app: {app_path}")
self._apps[app_path] = app
return app
return cast(ASGIApp, app)
except ImportError as e:
logger.error(f"Failed to import application {app_path}: {e}")
@ -137,7 +137,7 @@ class MountedApp:
class ASGIMountManager:
def __init__(self):
def __init__(self) -> None:
self._mounts: list[MountedApp] = []
self._loader = ASGIAppLoader()
@ -288,8 +288,8 @@ def create_django_app(
os.environ.setdefault("DJANGO_SETTINGS_MODULE", settings_module)
try:
from django.core.asgi import get_asgi_application
return get_asgi_application()
from django.core.asgi import get_asgi_application # type: ignore[import-untyped]
return cast(ASGIApp, get_asgi_application())
except ImportError as e:
logger.error(f"Failed to load Django application: {e}")
return None