summaryrefslogtreecommitdiff
path: root/django
diff options
context:
space:
mode:
authorZoltan Gyarmati <mr.zoltan.gyarmati@gmail.com>2017-02-07 10:17:36 +0100
committerTim Graham <timograham@gmail.com>2017-02-07 08:54:21 -0500
commit41ba27fefdd313333d94408802afff36a9eedb83 (patch)
tree46a9790184dad74e15e70edc8627b078d3f4ccf6 /django
parent10c47f7b47c3b58eda579918d8381a066d43e788 (diff)
Fixed #27815 -- Made LoginView pass the request kwarg to AuthenticationForm.
Diffstat (limited to 'django')
-rw-r--r--django/contrib/auth/views.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/django/contrib/auth/views.py b/django/contrib/auth/views.py
index b2c37ebdb7..e24af5d9b0 100644
--- a/django/contrib/auth/views.py
+++ b/django/contrib/auth/views.py
@@ -100,6 +100,11 @@ class LoginView(SuccessURLAllowedHostsMixin, FormView):
context.update(self.extra_context)
return context
+ def get_form_kwargs(self):
+ kwargs = super().get_form_kwargs()
+ kwargs['request'] = self.request
+ return kwargs
+
def login(request, *args, **kwargs):
warnings.warn(