Ticket #8131: auth_reverse.diff

File auth_reverse.diff, 1.8 KB (added by davenaff, 7 years ago)
  • contrib/auth/views.py

     
    55from django.contrib.auth.forms import PasswordResetForm, SetPasswordForm, PasswordChangeForm, AdminPasswordChangeForm
    66from django.contrib.auth.tokens import default_token_generator
    77from django.core.exceptions import PermissionDenied
     8from django.core.urlresolvers import reverse
    89from django.shortcuts import render_to_response, get_object_or_404
    910from django.contrib.sites.models import Site, RequestSite
    1011from django.http import HttpResponseRedirect, Http404
     
    9091                if not Site._meta.installed:
    9192                    opts['domain_override'] = RequestSite(request).domain
    9293            form.save(**opts)
    93             return HttpResponseRedirect('%sdone/' % request.path)
     94            return HttpResponseRedirect(reverse('django.contrib.auth.views.password_reset_done'))
    9495    else:
    9596        form = password_reset_form()
    9697    return render_to_response(template_name, {
     
    121122            form = set_password_form(user, request.POST)
    122123            if form.is_valid():
    123124                form.save()
    124                 return HttpResponseRedirect("../done/")
     125                return HttpResponseRedirect(reverse('django.contrib.auth.views.password_reset_complete'))
    125126        else:
    126127            form = set_password_form(None)
    127128    else:
     
    139140        form = PasswordChangeForm(request.user, request.POST)
    140141        if form.is_valid():
    141142            form.save()
    142             return HttpResponseRedirect('%sdone/' % request.path)
     143            return HttpResponseRedirect(reverse('django.contrib.auth.views.password_change_done'))
    143144    else:
    144145        form = PasswordChangeForm(request.user)
    145146    return render_to_response(template_name, {
Back to Top