mirror of https://github.com/django/django.git
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
This commit is contained in:
parent
bfac0b7385
commit
bb30805452
|
@ -5,6 +5,7 @@ from django.contrib.auth.forms import AuthenticationForm
|
|||
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, {
|
||||
|
|
Loading…
Reference in New Issue