Opened 111 minutes ago
Closed 25 minutes ago
#37037 closed Cleanup/optimization (invalid)
decorator_from_middleware() docs contain stale reference to Django 1.9
| Reported by: | EoinShaughs | Owned by: | |
|---|---|---|---|
| Component: | Documentation | Version: | 6.0 |
| Severity: | Normal | Keywords: | |
| Cc: | Triage Stage: | Unreviewed | |
| Has patch: | yes | Needs documentation: | no |
| Needs tests: | no | Patch needs improvement: | no |
| Easy pickings: | no | UI/UX: | no |
Description
The docstring for decorator_from_middleware() in docs/ref/utils.txt states it "assumes middleware that's compatible with the old style of Django 1.9 and earlier", which is misleading. MIDDLEWARE_CLASSES was removed in Django 2.0, and the function works with any middleware implementing the standard hook methods. The source code docstring in django/utils/decorators.py contains no such restriction.
Change History (2)
comment:1 by , 103 minutes ago
| Has patch: | set |
|---|
comment:2 by , 25 minutes ago
| Resolution: | → invalid |
|---|---|
| Status: | new → closed |
I wouldn't call process_request(), etc. "standard hook methods" as your PR proposes because these method don't work unless you use django.utils.deprecation.MiddlewareMixin. There is still a section regarding upgrading pre-Django 1.10-style middleware, so IMO, the version reference isn't stale.
https://github.com/django/django/pull/21109