diff --git a/django/contrib/auth/__init__.py b/django/contrib/auth/__init__.py index e07b32c1db..d752e3172b 100644 --- a/django/contrib/auth/__init__.py +++ b/django/contrib/auth/__init__.py @@ -205,7 +205,7 @@ async def alogin(request, user, backend=None): # RemovedInDjango61Warning. if user is None: warnings.warn( - "Fallback to request.user when user is None will be removed.", + "Fallback to request.auser() when user is None will be removed.", RemovedInDjango61Warning, stacklevel=2, ) diff --git a/docs/internals/deprecation.txt b/docs/internals/deprecation.txt index 81a9d72860..0e2a7ffb36 100644 --- a/docs/internals/deprecation.txt +++ b/docs/internals/deprecation.txt @@ -64,9 +64,9 @@ details on these changes. * The ``all`` keyword argument of ``django.contrib.staticfiles.finders.find()`` will be removed. -* The fallback to ``request.user`` when ``user`` is ``None`` in - ``django.contrib.auth.login()`` and ``django.contrib.auth.alogin()`` will be - removed. +* Fallbacks to ``request.user`` and ``request.auser()`` when ``user`` is + ``None`` in ``django.contrib.auth.login()`` and + ``django.contrib.auth.alogin()``, respectively, will be removed. * The ``ordering`` keyword argument of the PostgreSQL specific aggregation functions ``django.contrib.postgres.aggregates.ArrayAgg``, diff --git a/docs/releases/5.2.txt b/docs/releases/5.2.txt index feaeb9436a..20d82db98e 100644 --- a/docs/releases/5.2.txt +++ b/docs/releases/5.2.txt @@ -479,9 +479,9 @@ Miscellaneous * The ``all`` argument for the ``django.contrib.staticfiles.finders.find()`` function is deprecated in favor of the ``find_all`` argument. -* The fallback to ``request.user`` when ``user`` is ``None`` in - ``django.contrib.auth.login()`` and ``django.contrib.auth.alogin()`` will be - removed. +* Fallbacks to ``request.user`` and ``request.auser()`` when ``user`` is + ``None`` in ``django.contrib.auth.login()`` and + ``django.contrib.auth.alogin()``, respectively, are deprecated. * The ``ordering`` keyword argument of the PostgreSQL specific aggregation functions ``django.contrib.postgres.aggregates.ArrayAgg``, diff --git a/tests/async/test_async_auth.py b/tests/async/test_async_auth.py index 94c5f2ddb4..d872a4c5bb 100644 --- a/tests/async/test_async_auth.py +++ b/tests/async/test_async_auth.py @@ -79,7 +79,7 @@ class AsyncAuthTest(TestCase): ), self.assertWarnsMessage( RemovedInDjango61Warning, - "Fallback to request.user when user is None will be removed.", + "Fallback to request.auser() when user is None will be removed.", ), ): await alogin(request, None) @@ -100,7 +100,7 @@ class AsyncAuthTest(TestCase): ), self.assertWarnsMessage( RemovedInDjango61Warning, - "Fallback to request.user when user is None will be removed.", + "Fallback to request.auser() when user is None will be removed.", ), ): await alogin(request, None) @@ -116,7 +116,7 @@ class AsyncAuthTest(TestCase): request.session = await self.client.asession() with self.assertWarnsMessage( RemovedInDjango61Warning, - "Fallback to request.user when user is None will be removed.", + "Fallback to request.auser() when user is None will be removed.", ): await alogin(request, None) user = await aget_user(request)