summaryrefslogtreecommitdiff
path: root/django
diff options
context:
space:
mode:
authorZach Liu <zachliugis@gmail.com>2017-09-03 12:05:18 -0400
committerTim Graham <timograham@gmail.com>2017-09-03 12:05:18 -0400
commitf8e0557b01ebbb11478cfb012c4cafc67f1213c1 (patch)
tree0676bf14dc3a365d29135d1230a7f9fbf8e4e420 /django
parentf9db06cf0812ee017b34bc786e1bf96e40f2327b (diff)
[1.11.x] Fixed #28550 -- Restored contrib.auth's login() and logout() views' respect of positional arguments.
Regression in 78963495d0caadb77eb97ccf319ef0ba3b204fb5.
Diffstat (limited to 'django')
-rw-r--r--django/contrib/auth/views.py25
1 files changed, 21 insertions, 4 deletions
diff --git a/django/contrib/auth/views.py b/django/contrib/auth/views.py
index f8934e9edb..aa3ca10dfb 100644
--- a/django/contrib/auth/views.py
+++ b/django/contrib/auth/views.py
@@ -133,12 +133,21 @@ class LoginView(SuccessURLAllowedHostsMixin, FormView):
@deprecate_current_app
-def login(request, *args, **kwargs):
+def login(request, template_name='registration/login.html',
+ redirect_field_name=REDIRECT_FIELD_NAME,
+ authentication_form=AuthenticationForm,
+ extra_context=None, redirect_authenticated_user=False):
warnings.warn(
'The login() view is superseded by the class-based LoginView().',
RemovedInDjango21Warning, stacklevel=2
)
- return LoginView.as_view(**kwargs)(request, *args, **kwargs)
+ return LoginView.as_view(
+ template_name=template_name,
+ redirect_field_name=redirect_field_name,
+ form_class=authentication_form,
+ extra_context=extra_context,
+ redirect_authenticated_user=redirect_authenticated_user,
+ )(request)
class LogoutView(SuccessURLAllowedHostsMixin, TemplateView):
@@ -202,12 +211,20 @@ class LogoutView(SuccessURLAllowedHostsMixin, TemplateView):
@deprecate_current_app
-def logout(request, *args, **kwargs):
+def logout(request, next_page=None,
+ template_name='registration/logged_out.html',
+ redirect_field_name=REDIRECT_FIELD_NAME,
+ extra_context=None):
warnings.warn(
'The logout() view is superseded by the class-based LogoutView().',
RemovedInDjango21Warning, stacklevel=2
)
- return LogoutView.as_view(**kwargs)(request, *args, **kwargs)
+ return LogoutView.as_view(
+ next_page=next_page,
+ template_name=template_name,
+ redirect_field_name=redirect_field_name,
+ extra_context=extra_context,
+ )(request)
_sentinel = object()