Code

Ticket #10026: django_contrib_auth_views.diff

File django_contrib_auth_views.diff, 1.4 KB (added by jwmayfield, 5 years ago)
Line 
1Index: django/contrib/auth/views.py
2===================================================================
3--- django/contrib/auth/views.py        (revision 9843)
4+++ django/contrib/auth/views.py        (working copy)
5@@ -116,10 +116,11 @@
6         raise Http404
7 
8     user = get_object_or_404(User, id=uid_int)
9-    context_instance = RequestContext(request)
10+    #context_instance = RequestContext(request)
11 
12     if token_generator.check_token(user, token):
13-        context_instance['validlink'] = True
14+        #context_instance['validlink'] = True
15+       validlink = True
16         if request.method == 'POST':
17             form = set_password_form(user, request.POST)
18             if form.is_valid():
19@@ -128,10 +129,12 @@
20         else:
21             form = set_password_form(None)
22     else:
23-        context_instance['validlink'] = False
24+        #context_instance['validlink'] = False
25+       validlink = False
26         form = None
27-    context_instance['form'] = form   
28-    return render_to_response(template_name, context_instance=context_instance)
29+    #context_instance['form'] = form   
30+    #return render_to_response(template_name, context_instance=context_instance)
31+    return render_to_response(template_name, {'validlink': validlink, 'form': form}, context_instance=RequestContext(request))
32 
33 def password_reset_complete(request, template_name='registration/password_reset_complete.html'):
34     return render_to_response(template_name, context_instance=RequestContext(request,