mirror of https://github.com/django/django.git
Refs #27815 -- Reordered LoginView.get_form_kwargs().
This commit is contained in:
parent
41ba27fefd
commit
854f695014
django/contrib/auth
|
@ -83,6 +83,11 @@ class LoginView(SuccessURLAllowedHostsMixin, FormView):
|
||||||
def get_form_class(self):
|
def get_form_class(self):
|
||||||
return self.authentication_form or self.form_class
|
return self.authentication_form or self.form_class
|
||||||
|
|
||||||
|
def get_form_kwargs(self):
|
||||||
|
kwargs = super().get_form_kwargs()
|
||||||
|
kwargs['request'] = self.request
|
||||||
|
return kwargs
|
||||||
|
|
||||||
def form_valid(self, form):
|
def form_valid(self, form):
|
||||||
"""Security check complete. Log the user in."""
|
"""Security check complete. Log the user in."""
|
||||||
auth_login(self.request, form.get_user())
|
auth_login(self.request, form.get_user())
|
||||||
|
@ -100,11 +105,6 @@ class LoginView(SuccessURLAllowedHostsMixin, FormView):
|
||||||
context.update(self.extra_context)
|
context.update(self.extra_context)
|
||||||
return context
|
return context
|
||||||
|
|
||||||
def get_form_kwargs(self):
|
|
||||||
kwargs = super().get_form_kwargs()
|
|
||||||
kwargs['request'] = self.request
|
|
||||||
return kwargs
|
|
||||||
|
|
||||||
|
|
||||||
def login(request, *args, **kwargs):
|
def login(request, *args, **kwargs):
|
||||||
warnings.warn(
|
warnings.warn(
|
||||||
|
|
Loading…
Reference in New Issue