1
0
mirror of https://github.com/django/django.git synced 2025-08-27 04:09:12 +00:00

Refs #35530 -- Corrected deprecation message in auth.alogin().

Follow up to ceecd518b19044181a3598c55ebed7c2545963cc.
This commit is contained in:
Mariusz Felisiak 2025-08-19 20:57:32 +02:00 committed by Sarah Boyce
parent 0b2493a0da
commit b3166e1e15
4 changed files with 10 additions and 10 deletions

View File

@ -205,7 +205,7 @@ async def alogin(request, user, backend=None):
# RemovedInDjango61Warning. # RemovedInDjango61Warning.
if user is None: if user is None:
warnings.warn( 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, RemovedInDjango61Warning,
stacklevel=2, stacklevel=2,
) )

View File

@ -64,9 +64,9 @@ details on these changes.
* The ``all`` keyword argument of ``django.contrib.staticfiles.finders.find()`` * The ``all`` keyword argument of ``django.contrib.staticfiles.finders.find()``
will be removed. will be removed.
* The fallback to ``request.user`` when ``user`` is ``None`` in * Fallbacks to ``request.user`` and ``request.auser()`` when ``user`` is
``django.contrib.auth.login()`` and ``django.contrib.auth.alogin()`` will be ``None`` in ``django.contrib.auth.login()`` and
removed. ``django.contrib.auth.alogin()``, respectively, will be removed.
* The ``ordering`` keyword argument of the PostgreSQL specific aggregation * The ``ordering`` keyword argument of the PostgreSQL specific aggregation
functions ``django.contrib.postgres.aggregates.ArrayAgg``, functions ``django.contrib.postgres.aggregates.ArrayAgg``,

View File

@ -479,9 +479,9 @@ Miscellaneous
* The ``all`` argument for the ``django.contrib.staticfiles.finders.find()`` * The ``all`` argument for the ``django.contrib.staticfiles.finders.find()``
function is deprecated in favor of the ``find_all`` argument. function is deprecated in favor of the ``find_all`` argument.
* The fallback to ``request.user`` when ``user`` is ``None`` in * Fallbacks to ``request.user`` and ``request.auser()`` when ``user`` is
``django.contrib.auth.login()`` and ``django.contrib.auth.alogin()`` will be ``None`` in ``django.contrib.auth.login()`` and
removed. ``django.contrib.auth.alogin()``, respectively, are deprecated.
* The ``ordering`` keyword argument of the PostgreSQL specific aggregation * The ``ordering`` keyword argument of the PostgreSQL specific aggregation
functions ``django.contrib.postgres.aggregates.ArrayAgg``, functions ``django.contrib.postgres.aggregates.ArrayAgg``,

View File

@ -79,7 +79,7 @@ class AsyncAuthTest(TestCase):
), ),
self.assertWarnsMessage( self.assertWarnsMessage(
RemovedInDjango61Warning, 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) await alogin(request, None)
@ -100,7 +100,7 @@ class AsyncAuthTest(TestCase):
), ),
self.assertWarnsMessage( self.assertWarnsMessage(
RemovedInDjango61Warning, 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) await alogin(request, None)
@ -116,7 +116,7 @@ class AsyncAuthTest(TestCase):
request.session = await self.client.asession() request.session = await self.client.asession()
with self.assertWarnsMessage( with self.assertWarnsMessage(
RemovedInDjango61Warning, 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) await alogin(request, None)
user = await aget_user(request) user = await aget_user(request)