Leaklens

django__django-13810

MiddlewareNotUsed leaves undesired side effects when loading middleware in ASGI context

Verdict: the issue points to the file or function that was changed (Tier B).

I notice that in ​https://github.com/django/django/blob/3.1.4/django/core/handlers/base.py#L58 while MiddlewareNotUsed causes the loop to skip futher processing and go to next middleware, it does leave handler variable overwritten with output of self.adapt_method_mode().

The text points to the exact place to change: “I notice that in ​https://github.com/django/django/blob/3.1.4/django/core/handlers/base.py#L58 while MiddlewareNotUsed causes the loop to skip futher processing and go t…”

All SWE-bench Verified tasks · more django/django tasks · How the check works