Opened 4 months ago
Closed 4 months ago
#35620 closed Bug (invalid)
LOGIN_REDIRECT_URL has no effect in admin
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 (last modified by )
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.
Change History (5)
comment:1 by , 4 months ago
Component: | Uncategorized → contrib.admin |
---|
comment:2 by , 4 months ago
Keywords: | admin login LOGIN_REDIRECT_URL added |
---|
comment:3 by , 4 months ago
Description: | modified (diff) |
---|
comment:4 by , 4 months ago
Type: | Uncategorized → Bug |
---|
comment:5 by , 4 months ago
Resolution: | → invalid |
---|---|
Status: | new → closed |
Summary: | LOGIN_REDIRECT_URL has no effect. → LOGIN_REDIRECT_URL has no effect in admin |
Note:
See TracTickets
for help on using tickets.
I think it's intended behavior. While the admin login does use
LoginView
, the setting isn't meant to apply there. You shouldn't use the admin's login page for non-admin purposes.