diff --git a/django/contrib/admin/sites.py b/django/contrib/admin/sites.py
index 7e94bbf..9d0c65d 100644
a
|
b
|
class AdminSite(object):
|
194 | 194 | Handles the "change password" task -- both form display and validation. |
195 | 195 | """ |
196 | 196 | from django.contrib.auth.views import password_change |
197 | | return password_change(request) |
| 197 | return password_change(request, |
| 198 | post_save_redirect='%spassword_change/done/' % self.root_path) |
198 | 199 | |
199 | 200 | def password_change_done(self, request): |
200 | 201 | """ |
diff --git a/django/contrib/auth/views.py b/django/contrib/auth/views.py
index 43693d6..a074f22 100644
a
|
b
|
def redirect_to_login(next, login_url=None, redirect_field_name=REDIRECT_FIELD_N
|
73 | 73 | |
74 | 74 | def password_reset(request, is_admin_site=False, template_name='registration/password_reset_form.html', |
75 | 75 | email_template_name='registration/password_reset_email.html', |
76 | | password_reset_form=PasswordResetForm, token_generator=default_token_generator): |
| 76 | password_reset_form=PasswordResetForm, token_generator=default_token_generator, |
| 77 | post_rest_redirect=None): |
| 78 | if post_reset_redirect is None: |
| 79 | post_reset_redirect = reverse('django.contrib.auth.views.password_reset_done') |
77 | 80 | if request.method == "POST": |
78 | 81 | form = password_reset_form(request.POST) |
79 | 82 | if form.is_valid(): |
… |
… |
def password_reset(request, is_admin_site=False, template_name='registration/pas
|
87 | 90 | if not Site._meta.installed: |
88 | 91 | opts['domain_override'] = RequestSite(request).domain |
89 | 92 | form.save(**opts) |
90 | | return HttpResponseRedirect(reverse('django.contrib.auth.views.password_reset_done')) |
| 93 | return HttpResponseRedirect(post_reset_redirect) |
91 | 94 | else: |
92 | 95 | form = password_reset_form() |
93 | 96 | return render_to_response(template_name, { |
… |
… |
def password_reset_done(request, template_name='registration/password_reset_done
|
98 | 101 | return render_to_response(template_name, context_instance=RequestContext(request)) |
99 | 102 | |
100 | 103 | def password_reset_confirm(request, uidb36=None, token=None, template_name='registration/password_reset_confirm.html', |
101 | | token_generator=default_token_generator, set_password_form=SetPasswordForm): |
| 104 | token_generator=default_token_generator, set_password_form=SetPasswordForm, |
| 105 | post_reset_redirect=None): |
102 | 106 | """ |
103 | 107 | View that checks the hash in a password reset link and presents a |
104 | 108 | form for entering a new password. |
105 | 109 | """ |
106 | 110 | assert uidb36 is not None and token is not None # checked by URLconf |
| 111 | if post_reset_redirect is None: |
| 112 | post_reset_redirect = reverse('django.contrib.auth.views.password_reset_complete') |
107 | 113 | try: |
108 | 114 | uid_int = base36_to_int(uidb36) |
109 | 115 | except ValueError: |
… |
… |
def password_reset_confirm(request, uidb36=None, token=None, template_name='regi
|
118 | 124 | form = set_password_form(user, request.POST) |
119 | 125 | if form.is_valid(): |
120 | 126 | form.save() |
121 | | return HttpResponseRedirect(reverse('django.contrib.auth.views.password_reset_complete')) |
| 127 | return HttpResponseRedirect(post_reset_redirect) |
122 | 128 | else: |
123 | 129 | form = set_password_form(None) |
124 | 130 | else: |
… |
… |
def password_reset_complete(request, template_name='registration/password_reset_
|
131 | 137 | return render_to_response(template_name, context_instance=RequestContext(request, |
132 | 138 | {'login_url': settings.LOGIN_URL})) |
133 | 139 | |
134 | | def password_change(request, template_name='registration/password_change_form.html'): |
| 140 | def password_change(request, template_name='registration/password_change_form.html', |
| 141 | post_change_redirect=None): |
| 142 | if post_save_redirect is None: |
| 143 | post_save_redirect = reverse('django.contrib.auth.views.password_change_done') |
135 | 144 | if request.method == "POST": |
136 | 145 | form = PasswordChangeForm(request.user, request.POST) |
137 | 146 | if form.is_valid(): |
138 | 147 | form.save() |
139 | | return HttpResponseRedirect(reverse('django.contrib.auth.views.password_change_done')) |
| 148 | return HttpResponseRedirect(post_save_redirect) |
140 | 149 | else: |
141 | 150 | form = PasswordChangeForm(request.user) |
142 | 151 | return render_to_response(template_name, { |