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...
1 parent 48c706a commit cf438282aa76ebf7a05dda55febbeca34be64db8 @spookylukey spookylukey committed Jun 24, 2008
Showing with 4 additions and 3 deletions.
  1. +4 −3 django/contrib/auth/views.py
View
7 django/contrib/auth/views.py
@@ -65,17 +65,18 @@ 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'])
else:
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))

0 comments on commit cf43828

Please sign in to comment.