1
0
mirror of https://github.com/django/django.git synced 2025-08-25 11:19:12 +00:00

[5.2.x] Refs #35530 -- Corrected deprecation message in auth.alogin().

Follow up to ceecd518b19044181a3598c55ebed7c2545963cc.

Backport of b3166e1e15824aedb7a609dfda18ef36ea023d06 from main.
This commit is contained in:
Mariusz Felisiak 2025-08-19 20:57:32 +02:00 committed by Sarah Boyce
parent 98972b53aa
commit 9c9ed6fd7a
4 changed files with 10 additions and 10 deletions

View File

@ -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,
)

View File

@ -18,9 +18,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``,

View File

@ -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``,

View File

@ -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)