[Django] #35620: LOGIN_REDIRECT_URL has no effect.

29 views
Skip to first unread message

Django

unread,
Jul 20, 2024, 5:35:43 AM7/20/24
to django-...@googlegroups.com
#35620: LOGIN_REDIRECT_URL has no effect.
------------------------------+-----------------------------------------
Reporter: holasoftware | Type: Uncategorized
Status: new | Component: Uncategorized
Version: 5.1 | Severity: Normal
Keywords: | Triage Stage: Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
------------------------------+-----------------------------------------
In the class method
{{{
def login(self, request, extra_context=None):
}}}

of the class AdminSite, these lines have to removed:
{{{
if (
REDIRECT_FIELD_NAME not in request.GET
and REDIRECT_FIELD_NAME not in request.POST
):
context[REDIRECT_FIELD_NAME] = reverse("admin:index",
current_app=self.name)
}}}

https://github.com/django/django/blob/main/django/contrib/admin/sites.py#L431-L435

Otherwise the setting
{{{
LOGIN_REDIRECT_URL
}}}
has no effect.
--
Ticket URL: <https://code.djangoproject.com/ticket/35620>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

Django

unread,
Jul 20, 2024, 5:36:06 AM7/20/24
to django-...@googlegroups.com
#35620: LOGIN_REDIRECT_URL has no effect.
-------------------------------+--------------------------------------
Reporter: holasoftware | Owner: (none)
Type: Uncategorized | Status: new
Component: contrib.admin | Version: 5.1
Severity: Normal | Resolution:
Keywords: | Triage Stage: Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------+--------------------------------------
Changes (by holasoftware):

* component: Uncategorized => contrib.admin

--
Ticket URL: <https://code.djangoproject.com/ticket/35620#comment:1>

Django

unread,
Jul 20, 2024, 5:38:34 AM7/20/24
to django-...@googlegroups.com
#35620: LOGIN_REDIRECT_URL has no effect.
-------------------------------------+-------------------------------------
Reporter: holasoftware | Owner: (none)
Type: Uncategorized | Status: new
Component: contrib.admin | Version: 5.1
Severity: Normal | Resolution:
Keywords: admin, login, | Triage Stage:
LOGIN_REDIRECT_URL | Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by holasoftware):

* keywords: => admin, login, LOGIN_REDIRECT_URL

--
Ticket URL: <https://code.djangoproject.com/ticket/35620#comment:2>

Django

unread,
Jul 20, 2024, 5:39:51 AM7/20/24
to django-...@googlegroups.com
#35620: LOGIN_REDIRECT_URL has no effect.
-------------------------------------+-------------------------------------
Reporter: holasoftware | Owner: (none)
Type: Uncategorized | Status: new
Component: contrib.admin | Version: 5.1
Severity: Normal | Resolution:
Keywords: admin, login, | Triage Stage:
LOGIN_REDIRECT_URL | Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Description changed by holasoftware:

Old description:

> In the class method
> {{{
> def login(self, request, extra_context=None):
> }}}
>
> of the class AdminSite, these lines have to removed:
> {{{
> if (
> REDIRECT_FIELD_NAME not in request.GET
> and REDIRECT_FIELD_NAME not in request.POST
> ):
> context[REDIRECT_FIELD_NAME] = reverse("admin:index",
> current_app=self.name)
> }}}
>
> https://github.com/django/django/blob/main/django/contrib/admin/sites.py#L431-L435
>
> Otherwise the setting
> {{{
> LOGIN_REDIRECT_URL
> }}}
> has no effect.

New description:

In the method
{{{
def login(self, request, extra_context=None):
}}}

of the class AdminSite, these lines have to removed:
{{{
if (
REDIRECT_FIELD_NAME not in request.GET
and REDIRECT_FIELD_NAME not in request.POST
):
context[REDIRECT_FIELD_NAME] = reverse("admin:index",
current_app=self.name)
}}}

https://github.com/django/django/blob/main/django/contrib/admin/sites.py#L431-L435

Otherwise the setting
{{{
LOGIN_REDIRECT_URL
}}}
has no effect.

--
--
Ticket URL: <https://code.djangoproject.com/ticket/35620#comment:3>

Django

unread,
Jul 20, 2024, 5:41:19 AM7/20/24
to django-...@googlegroups.com
#35620: LOGIN_REDIRECT_URL has no effect.
-------------------------------------+-------------------------------------
Reporter: holasoftware | Owner: (none)
Type: Bug | Status: new
Component: contrib.admin | Version: 5.1
Severity: Normal | Resolution:
Keywords: admin, login, | Triage Stage:
LOGIN_REDIRECT_URL | Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by holasoftware):

* type: Uncategorized => Bug

--
Ticket URL: <https://code.djangoproject.com/ticket/35620#comment:4>
Reply all
Reply to author
Forward
0 new messages