Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

newforms-admin: Fixed #6905 - allow custom form class to be used for …

…password reset view

Thanks programmerq for the idea


git-svn-id: http://code.djangoproject.com/svn/django/branches/newforms-admin@7735 bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information...
commit cf438282aa76ebf7a05dda55febbeca34be64db8 1 parent 48c706a
@spookylukey spookylukey authored
Showing with 4 additions and 3 deletions.
  1. +4 −3 django/contrib/auth/views.py
View
7 django/contrib/auth/views.py
@@ -65,9 +65,10 @@ def redirect_to_login(next, login_url=None, redirect_field_name=REDIRECT_FIELD_N
return HttpResponseRedirect('%s?%s=%s' % (login_url, redirect_field_name, next))
def password_reset(request, is_admin_site=False, template_name='registration/password_reset_form.html',
- email_template_name='registration/password_reset_email.html'):
+ email_template_name='registration/password_reset_email.html',
+ password_reset_form=PasswordResetForm):
if request.method == "POST":
- form = PasswordResetForm(request.POST)
+ form = password_reset_form(request.POST)
if form.is_valid():
if is_admin_site:
form.save(domain_override=request.META['HTTP_HOST'])
@@ -75,7 +76,7 @@ def password_reset(request, is_admin_site=False, template_name='registration/pas
form.save(email_template_name=email_template_name)
return HttpResponseRedirect('%sdone/' % request.path)
else:
- form = PasswordResetForm()
+ form = password_reset_form()
return render_to_response(template_name, {
'form': form,
}, context_instance=RequestContext(request))
Please sign in to comment.
Something went wrong with that request. Please try again.