diff --git a/django-stubs/contrib/sessions/middleware.pyi b/django-stubs/contrib/sessions/middleware.pyi index 44b3b38..ca3f565 100644 --- a/django-stubs/contrib/sessions/middleware.pyi +++ b/django-stubs/contrib/sessions/middleware.pyi @@ -1,14 +1,12 @@ -from typing import Callable, Optional, Type +from typing import Type from django.contrib.sessions.backends.base import SessionBase from django.core.handlers.wsgi import WSGIRequest from django.http.request import HttpRequest -from django.http.response import HttpResponseBase +from django.http.response import HttpResponse from django.utils.deprecation import MiddlewareMixin class SessionMiddleware(MiddlewareMixin): - get_response: Callable[[WSGIRequest], HttpResponseBase] = ... SessionStore: Type[SessionBase] = ... - def __init__(self, get_response: Optional[Callable] = ...) -> None: ... def process_request(self, request: HttpRequest) -> None: ... - def process_response(self, request: WSGIRequest, response: HttpResponseBase) -> HttpResponseBase: ... + def process_response(self, request: WSGIRequest, response: HttpResponse) -> HttpResponse: ... diff --git a/django-stubs/utils/deprecation.pyi b/django-stubs/utils/deprecation.pyi index 3e8ed14..320382e 100644 --- a/django-stubs/utils/deprecation.pyi +++ b/django-stubs/utils/deprecation.pyi @@ -1,7 +1,7 @@ from typing import Any, Callable, Optional, Type -from django.http.request import HttpRequest -from django.http.response import HttpResponseBase +from django.core.handlers.wsgi import WSGIRequest +from django.http.response import HttpResponse class RemovedInDjango30Warning(PendingDeprecationWarning): ... class RemovedInNextVersionWarning(DeprecationWarning): ... @@ -22,10 +22,10 @@ class RenameMethodsBase(type): class DeprecationInstanceCheck(type): alternative: str - deprecation_warning: Type[django.utils.deprecation.RemovedInNextVersionWarning] + deprecation_warning: Type[Warning] def __instancecheck__(self, instance: Any): ... class MiddlewareMixin: - get_response: Any = ... - def __init__(self, get_response: Optional[Callable] = ...) -> None: ... - def __call__(self, request: HttpRequest) -> HttpResponseBase: ... + get_response: Callable[[WSGIRequest], HttpResponse] = ... + def __init__(self, get_response: Optional[Callable[[WSGIRequest], HttpResponse]] = ...) -> None: ... + def __call__(self, request: WSGIRequest) -> HttpResponse: ...