Opened 7 years ago

Closed 3 years ago

#28216 closed New feature (fixed)

Add next_page to LoginView

Reported by: ThinkChaos Owned by: ThinkChaos
Component: contrib.auth Version: 1.11
Severity: Normal Keywords: auth, LoginView
Cc: Triage Stage: Ready for checkin
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

LogoutView has a next_page attribute used to override settings.LOGOUT_REDIRECT_URL.
It would be nice if LoginView had the same mechanism.

Change History (11)

comment:1 by Tim Graham, 7 years ago

Did you consider overriding the get_success_url() method? Perhaps that method could be documented.

Also there is settings.LOGIN_REDIRECT_URL. Do you have a use case that requires customizing the redirect for different login views?

Last edited 7 years ago by Tim Graham (previous) (diff)

comment:2 by ThinkChaos, 7 years ago

Yes I have, the issue with that is when redirect_authenticated_user = True, dispatch also has redirect logic.
No I don't. It's mostly for symmetry with LogoutView so that I have redirects in the same view file, and not in the settings.

comment:3 by Tim Graham, 7 years ago

Triage Stage: UnreviewedAccepted

I guess we could see what a patch looks like.

comment:4 by ThinkChaos, 7 years ago

Owner: changed from nobody to ThinkChaos
Status: newassigned

comment:5 by ThinkChaos, 7 years ago

comment:6 by Mads Jensen, 7 years ago

Needs tests: set

comment:7 by ThinkChaos, 7 years ago

Needs tests: unset

I just pushed tests.

Sorry it took so long, I didn't find the tests for LogoutView when I first checked.

comment:8 by Tim Graham, 7 years ago

Has patch: set
Patch needs improvement: set

comment:9 by Mariusz Felisiak, 3 years ago

Needs documentation: set
Patch needs improvement: unset

comment:10 by Mariusz Felisiak, 3 years ago

Needs documentation: unset
Triage Stage: AcceptedReady for checkin

comment:11 by Mariusz Felisiak <felisiak.mariusz@…>, 3 years ago

Resolution: fixed
Status: assignedclosed

In b99d6c9c:

Fixed #28216 -- Added next_page/get_default_redirect_url() to LoginView.

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