-
-
Notifications
You must be signed in to change notification settings - Fork 508
Closed
Labels
bugSomething isn't workingSomething isn't working
Description
Bug report
class MyMiddleware(MiddlewareMixin):
def __call__(
self, request: HttpRequest
) -> HttpResponseBase | Awaitable[HttpResponseBase]:
return self.get_response(request)
What's wrong
Return type"HttpResponseBase | Awaitable[HttpResponseBase]" of "call" incompatible with
return type "HttpResponseBase" in supertype "MiddlewareMixin" [override]
Unfortunately get_response()
returns HttpResponseBase | Awaitable[HttpResponseBase]
, but MiddlewareMixin.__call__
has a return type of HttpResponseBase
defined. I've tried using @sync_only_middleware
, but it looks like that's a no-op.
How is that should be
No error.
System information
- OS: N/A
- python version: 3.11
- django version: 4.1
- mypy version: 1.4
- django-stubs version: 4.2.2
- django-stubs-ext version: 4.2.2
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working