Opened 2 months ago

Last modified 2 months ago

#35620 closed Bug

LOGIN_REDIRECT_URL has no effect. — at Initial Version

Reported by: holasoftware Owned by:
Component: contrib.admin Version: 5.1
Severity: Normal Keywords: admin, login, LOGIN_REDIRECT_URL
Cc: Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

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.

Change History (0)

Note: See TracTickets for help on using tickets.
Back to Top