diff options
| author | Claude Paroz <claude@2xlibre.net> | 2019-09-26 19:06:35 +0200 |
|---|---|---|
| committer | Carlton Gibson <carlton@noumenal.es> | 2020-02-18 20:03:44 +0100 |
| commit | 4d973f593932285cd2f765400d915305d8e7333a (patch) | |
| tree | 1cc48fd9e979d77906e522ecad2689d156d1377f /docs | |
| parent | a34cb5a6d408203f4fbdb364fc9768c026eda224 (diff) | |
Refs #26601 -- Deprecated passing None as get_response arg to middleware classes.
This is the new contract since middleware refactoring in Django 1.10.
Co-authored-by: Carlton Gibson <carlton.gibson@noumenal.es>
Co-authored-by: Mariusz Felisiak <felisiak.mariusz@gmail.com>
Diffstat (limited to 'docs')
| -rw-r--r-- | docs/internals/deprecation.txt | 4 | ||||
| -rw-r--r-- | docs/releases/3.1.txt | 3 | ||||
| -rw-r--r-- | docs/topics/http/middleware.txt | 4 |
3 files changed, 9 insertions, 2 deletions
diff --git a/docs/internals/deprecation.txt b/docs/internals/deprecation.txt index 6b94bc1a3a..2d7a72ae2f 100644 --- a/docs/internals/deprecation.txt +++ b/docs/internals/deprecation.txt @@ -52,6 +52,10 @@ details on these changes. * Support for the pre-Django 3.1 password reset tokens in the admin site (that use the SHA-1 hashing algorithm) will be removed. +* The ``get_request`` argument for + ``django.utils.deprecation.MiddlewareMixin.__init__()`` will be required and + won't accept ``None``. + See the :ref:`Django 3.1 release notes <deprecated-features-3.1>` for more details on these changes. diff --git a/docs/releases/3.1.txt b/docs/releases/3.1.txt index 444cba34dc..59cfeb8157 100644 --- a/docs/releases/3.1.txt +++ b/docs/releases/3.1.txt @@ -525,6 +525,9 @@ Miscellaneous be reproduced exactly as ``request.headers.get('x-requested-with') == 'XMLHttpRequest'``. +* Passing ``None`` as the first argument to + ``django.utils.deprecation.MiddlewareMixin.__init__()`` is deprecated. + * The encoding format of cookies values used by :class:`~django.contrib.messages.storage.cookie.CookieStorage` is different from the format generated by older versions of Django. Support for the old diff --git a/docs/topics/http/middleware.txt b/docs/topics/http/middleware.txt index 3b96eae4e8..d72d39de5e 100644 --- a/docs/topics/http/middleware.txt +++ b/docs/topics/http/middleware.txt @@ -295,8 +295,8 @@ middleware classes that are compatible with both :setting:`MIDDLEWARE` and the old ``MIDDLEWARE_CLASSES``. All middleware classes included with Django are compatible with both settings. -The mixin provides an ``__init__()`` method that accepts an optional -``get_response`` argument and stores it in ``self.get_response``. +The mixin provides an ``__init__()`` method that requires a ``get_response`` +argument and stores it in ``self.get_response``. The ``__call__()`` method: |
