Permalink
Browse files

Fixed #8131: use reverse() in auth views. Patch from davenaff.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@8334 bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information...
1 parent bfac0b7 commit bb308054529ad01c079bdaedfb41a85eb5ae97a9 @jacobian jacobian committed Aug 12, 2008
Showing with 4 additions and 3 deletions.
  1. +4 −3 django/contrib/auth/views.py
@@ -5,6 +5,7 @@
from django.contrib.auth.forms import PasswordResetForm, SetPasswordForm, PasswordChangeForm, AdminPasswordChangeForm
from django.contrib.auth.tokens import default_token_generator
from django.core.exceptions import PermissionDenied
+from django.core.urlresolvers import reverse
from django.shortcuts import render_to_response, get_object_or_404
from django.contrib.sites.models import Site, RequestSite
from django.http import HttpResponseRedirect, Http404
@@ -90,7 +91,7 @@ def password_reset(request, is_admin_site=False, template_name='registration/pas
if not Site._meta.installed:
opts['domain_override'] = RequestSite(request).domain
form.save(**opts)
- return HttpResponseRedirect('%sdone/' % request.path)
+ return HttpResponseRedirect(reverse('django.contrib.auth.views.password_reset_done'))
else:
form = password_reset_form()
return render_to_response(template_name, {
@@ -121,7 +122,7 @@ def password_reset_confirm(request, uidb36=None, token=None, template_name='regi
form = set_password_form(user, request.POST)
if form.is_valid():
form.save()
- return HttpResponseRedirect("../done/")
+ return HttpResponseRedirect(reverse('django.contrib.auth.views.password_reset_complete'))
else:
form = set_password_form(None)
else:
@@ -139,7 +140,7 @@ def password_change(request, template_name='registration/password_change_form.ht
form = PasswordChangeForm(request.user, request.POST)
if form.is_valid():
form.save()
- return HttpResponseRedirect('%sdone/' % request.path)
+ return HttpResponseRedirect(reverse('django.contrib.auth.views.password_change_done'))
else:
form = PasswordChangeForm(request.user)
return render_to_response(template_name, {

0 comments on commit bb30805

Please sign in to comment.