Ticket #8131: auth_reverse.diff
File auth_reverse.diff, 1.8 KB (added by , 16 years ago) |
---|
-
contrib/auth/views.py
5 5 from django.contrib.auth.forms import PasswordResetForm, SetPasswordForm, PasswordChangeForm, AdminPasswordChangeForm 6 6 from django.contrib.auth.tokens import default_token_generator 7 7 from django.core.exceptions import PermissionDenied 8 from django.core.urlresolvers import reverse 8 9 from django.shortcuts import render_to_response, get_object_or_404 9 10 from django.contrib.sites.models import Site, RequestSite 10 11 from django.http import HttpResponseRedirect, Http404 … … 90 91 if not Site._meta.installed: 91 92 opts['domain_override'] = RequestSite(request).domain 92 93 form.save(**opts) 93 return HttpResponseRedirect( '%sdone/' % request.path)94 return HttpResponseRedirect(reverse('django.contrib.auth.views.password_reset_done')) 94 95 else: 95 96 form = password_reset_form() 96 97 return render_to_response(template_name, { … … 121 122 form = set_password_form(user, request.POST) 122 123 if form.is_valid(): 123 124 form.save() 124 return HttpResponseRedirect( "../done/")125 return HttpResponseRedirect(reverse('django.contrib.auth.views.password_reset_complete')) 125 126 else: 126 127 form = set_password_form(None) 127 128 else: … … 139 140 form = PasswordChangeForm(request.user, request.POST) 140 141 if form.is_valid(): 141 142 form.save() 142 return HttpResponseRedirect( '%sdone/' % request.path)143 return HttpResponseRedirect(reverse('django.contrib.auth.views.password_change_done')) 143 144 else: 144 145 form = PasswordChangeForm(request.user) 145 146 return render_to_response(template_name, {