Changes between Version 10 and Version 12 of Ticket #33716
- Timestamp:
- May 17, 2022, 10:01:23 PM (3 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
Ticket #33716
- Property Summary async get_response can be a regular function too → async middleware can be a regular function too
-
Ticket #33716 – Description
v10 v12 39 39 40 40 {{{ 41 def is_next_middleware_async_capable(mw): 42 path = f'{mw.__class__.__module__}.{mw.__class__.__name__}' 43 next_index = settings.MIDDLEWARE.index(path) + 1 44 mw_class = import_string(settings.MIDDLEWARE[next_index]) 45 return mw_class.async_capable 46 47 41 48 def call_mw(mw, request, _call_mw=MiddlewareMixin.__call__): 42 if isinstance(request, ASGIRequest) and mw.async_capable:49 if isinstance(request, ASGIRequest) and is_next_middleware_async_capable(mw): 43 50 return mw.__acall__(request) 44 51 return _call_mw(mw, request)