diff --git a/django/contrib/admin/sites.py b/django/contrib/admin/sites.py
index c16ab6a..3f5ff8f 100644
a
|
b
|
class AdminSite(object):
|
33 | 33 | index_template = None |
34 | 34 | login_template = None |
35 | 35 | app_index_template = None |
| 36 | logout_template = None |
| 37 | password_change_template = None |
| 38 | password_change_done_template = None |
36 | 39 | |
37 | 40 | def __init__(self): |
38 | 41 | self._registry = {} # model_class class -> admin_class instance |
… |
… |
class AdminSite(object):
|
181 | 184 | Handles the "change password" task -- both form display and validation. |
182 | 185 | """ |
183 | 186 | from django.contrib.auth.views import password_change |
184 | | return password_change(request, |
185 | | post_change_redirect='%spassword_change/done/' % self.root_path) |
| 187 | redirect_to = '%spassword_change/done/' % self.root_path |
| 188 | if self.password_change_template is None: |
| 189 | return password_change(request, post_change_redirect=redirect_to) |
| 190 | return password_change(request, post_change_redirect=redirect_to, |
| 191 | template_name=self.password_change_template) |
186 | 192 | |
187 | 193 | def password_change_done(self, request): |
188 | 194 | """ |
189 | 195 | Displays the "success" page after a password change. |
190 | 196 | """ |
191 | 197 | from django.contrib.auth.views import password_change_done |
192 | | return password_change_done(request) |
| 198 | if self.password_change_done_template is None: |
| 199 | return password_change_done(request) |
| 200 | return password_change_done(request, |
| 201 | template_name=self.password_change_done_template) |
193 | 202 | |
194 | 203 | def i18n_javascript(self, request): |
195 | 204 | """ |
… |
… |
class AdminSite(object):
|
211 | 220 | This should *not* assume the user is already logged in. |
212 | 221 | """ |
213 | 222 | from django.contrib.auth.views import logout |
214 | | return logout(request) |
| 223 | if self.logout_template is None: |
| 224 | return logout(request) |
| 225 | return logout(request, template_name=self.logout_template) |
215 | 226 | logout = never_cache(logout) |
216 | 227 | |
217 | 228 | def login(self, request): |
diff --git a/django/contrib/auth/admin.py b/django/contrib/auth/admin.py
index 1e4c480..a38b748 100644
a
|
b
|
class GroupAdmin(admin.ModelAdmin):
|
16 | 16 | filter_horizontal = ('permissions',) |
17 | 17 | |
18 | 18 | class UserAdmin(admin.ModelAdmin): |
| 19 | add_form_template = None |
| 20 | change_user_password_template = None |
19 | 21 | fieldsets = ( |
20 | 22 | (None, {'fields': ('username', 'password')}), |
21 | 23 | (_('Personal info'), {'fields': ('first_name', 'last_name', 'email')}), |
… |
… |
class UserAdmin(admin.ModelAdmin):
|
60 | 62 | return HttpResponseRedirect('../%s/' % new_user.id) |
61 | 63 | else: |
62 | 64 | form = self.add_form() |
63 | | return render_to_response('admin/auth/user/add_form.html', { |
| 65 | return render_to_response(self.add_form_template or 'admin/auth/user/add_form.html', { |
64 | 66 | 'title': _('Add user'), |
65 | 67 | 'form': form, |
66 | 68 | 'is_popup': '_popup' in request.REQUEST, |
… |
… |
class UserAdmin(admin.ModelAdmin):
|
92 | 94 | return HttpResponseRedirect('..') |
93 | 95 | else: |
94 | 96 | form = self.change_password_form(user) |
95 | | return render_to_response('admin/auth/user/change_password.html', { |
| 97 | return render_to_response(self.change_user_password_template or 'admin/auth/user/change_password.html', { |
96 | 98 | 'title': _('Change password: %s') % escape(user.username), |
97 | 99 | 'form': form, |
98 | 100 | 'is_popup': '_popup' in request.REQUEST, |