Skip to content

Commit

Permalink
Fixed #7274 -- Improved the django.contrib.auth password_reset() view…
Browse files Browse the repository at this point in the history
… not to require the Sites framework. Thanks, joshrl

git-svn-id: http://code.djangoproject.com/svn/django/trunk@7748 bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information
adrianholovaty committed Jun 26, 2008
1 parent 2b926d4 commit 54f7da3
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion django/contrib/auth/views.py
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -75,7 +75,10 @@ def password_reset(request, is_admin_site=False, template_name='registration/pas
if is_admin_site: if is_admin_site:
form.save(domain_override=request.META['HTTP_HOST']) form.save(domain_override=request.META['HTTP_HOST'])
else: else:
form.save(email_template_name=email_template_name) if Site._meta.installed:
form.save(email_template_name=email_template_name)
else:
form.save(domain_override=RequestSite(request).domain, email_template_name=email_template_name)
return HttpResponseRedirect('%sdone/' % request.path) return HttpResponseRedirect('%sdone/' % request.path)
return render_to_response(template_name, {'form': oldforms.FormWrapper(form, new_data, errors)}, return render_to_response(template_name, {'form': oldforms.FormWrapper(form, new_data, errors)},
context_instance=RequestContext(request)) context_instance=RequestContext(request))
Expand Down

0 comments on commit 54f7da3

Please sign in to comment.