diff options
author | Olivier Le Thanh Duong <olivier@lethanh.be> | 2015-11-12 00:48:16 +0100 |
---|---|---|
committer | Tim Graham <timograham@gmail.com> | 2016-02-25 07:18:33 -0500 |
commit | 10781b4c6ff981f581157957d221e7621e0bf4ed (patch) | |
tree | 9223912fbf71db5e850bb9951e19a2edd26b40ab /tests/auth_tests/urls.py | |
parent | 4c18a8a3788a4cd25b75ae342a7244c5f775b213 (diff) | |
download | django-10781b4c6ff981f581157957d221e7621e0bf4ed.tar.gz |
Fixed #12233 -- Allowed redirecting authenticated users away from the login view.
contrib.auth.views.login() has a new parameter `redirect_authenticated_user`
to automatically redirect authenticated users visiting the login page.
Thanks to dmathieu and Alex Buchanan for the original code and to Carl Meyer
for the help and review.
Diffstat (limited to 'tests/auth_tests/urls.py')
-rw-r--r-- | tests/auth_tests/urls.py | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/tests/auth_tests/urls.py b/tests/auth_tests/urls.py index bc68c3f216..2b70c59a51 100644 --- a/tests/auth_tests/urls.py +++ b/tests/auth_tests/urls.py @@ -96,6 +96,8 @@ urlpatterns = auth_urlpatterns + [ url(r'^auth_processor_messages/$', auth_processor_messages), url(r'^custom_request_auth_login/$', custom_request_auth_login), url(r'^userpage/(.+)/$', userpage, name="userpage"), + url(r'^login/redirect_authenticated_user_default/$', views.login), + url(r'^login/redirect_authenticated_user/$', views.login, dict(redirect_authenticated_user=True)), # This line is only required to render the password reset with is_admin=True url(r'^admin/', admin.site.urls), |