Code

Ticket #7071: password-change-override-form.patch

File password-change-override-form.patch, 853 bytes (added by m.gajda@…, 6 years ago)
  • django/contrib/auth/views.py

     
    8282def password_reset_done(request, template_name='registration/password_reset_done.html'): 
    8383    return render_to_response(template_name, context_instance=RequestContext(request)) 
    8484 
    85 def password_change(request, template_name='registration/password_change_form.html'): 
     85def password_change(request, template_name='registration/password_change_form.html', password_change_form=PasswordChangeForm): 
    8686    new_data, errors = {}, {} 
    87     form = PasswordChangeForm(request.user) 
     87    form = password_change_form(request.user) 
    8888    if request.POST: 
    8989        new_data = request.POST.copy() 
    9090        errors = form.get_validation_errors(new_data)