Code

Ticket #377: login.py.diff

File login.py.diff, 869 bytes (added by Adam Endicott <leftwing17@…>, 9 years ago)
Line 
1Index: django/views/auth/login.py
2===================================================================
3--- django/views/auth/login.py  (revision 541)
4+++ django/views/auth/login.py  (working copy)
5@@ -7,7 +7,7 @@
6 
7 REDIRECT_FIELD_NAME = 'next'
8 
9-def login(request):
10+def login(request, template_name='registration/login'):
11     "Displays the login form and handles the login action."
12     manipulator = AuthenticationForm(request)
13     redirect_to = request.REQUEST.get(REDIRECT_FIELD_NAME, '')
14@@ -23,7 +23,7 @@
15         errors = {}
16     response = HttpResponse()
17     request.session.set_test_cookie()
18-    t = template_loader.get_template('registration/login')
19+    t = template_loader.get_template(template_name)
20     c = Context(request, {
21         'form': formfields.FormWrapper(manipulator, request.POST, errors),
22         REDIRECT_FIELD_NAME: redirect_to,