Ticket #7071: password_change_form.patch
File password_change_form.patch, 1.2 KB (added by , 16 years ago) |
---|
-
django/contrib/auth/views.py
138 138 {'login_url': settings.LOGIN_URL})) 139 139 140 140 def password_change(request, template_name='registration/password_change_form.html', 141 post_change_redirect=None): 141 post_change_redirect=None, 142 change_password_form=PasswordChangeForm): 142 143 if post_change_redirect is None: 143 144 post_change_redirect = reverse('django.contrib.auth.views.password_change_done') 144 145 if request.method == "POST": 145 form = PasswordChangeForm(request.user, request.POST)146 form = change_password_form(request.user, request.POST) 146 147 if form.is_valid(): 147 148 form.save() 148 149 return HttpResponseRedirect(post_change_redirect) 149 150 else: 150 form = PasswordChangeForm(request.user)151 form = change_password_form(request.user) 151 152 return render_to_response(template_name, { 152 153 'form': form, 153 154 }, context_instance=RequestContext(request))