public
Fork of django/django
Description: My branches, patches and nitpicks.
Homepage: http://www.djangoproject.com/
Clone URL: git://github.com/jezdez/django.git
Applied ticket8933-r8979.diff
jezdez (author)
Sat Sep 27 02:41:40 -0700 2008
commit  929242d1954d5510b385334f63c0cbe18a25aeef
tree    1d0acfe91d7cd84e8ba68b368f6ee2f7b2671c6a
parent  3360c1383c4e7ec78e986585e0913d7f9b4c9fc9
...
33
34
35
 
 
 
36
37
38
...
182
183
184
185
 
 
 
186
187
188
189
190
191
192
 
 
 
193
194
195
...
211
212
213
214
 
 
 
215
216
217
...
33
34
35
36
37
38
39
40
41
...
185
186
187
 
188
189
190
191
192
193
194
195
196
 
197
198
199
200
201
202
...
218
219
220
 
221
222
223
224
225
226
0
@@ -33,6 +33,9 @@ class AdminSite(object):
0
     index_template = None
0
     login_template = None
0
     app_index_template = None
0
+    logout_template = None
0
+    password_change_template = None
0
+    password_change_done_template = None
0
 
0
     def __init__(self):
0
         self._registry = {} # model_class class -> admin_class instance
0
@@ -182,14 +185,18 @@ class AdminSite(object):
0
         """
0
         from django.contrib.auth.views import password_change
0
         return password_change(request,
0
-            post_change_redirect='%spassword_change/done/' % self.root_path)
0
+            template_name=self.password_change_template or 'registration/password_change_form.html',
0
+            post_change_redirect='%spassword_change/done/' % self.root_path
0
+        )
0
 
0
     def password_change_done(self, request):
0
         """
0
         Displays the "success" page after a password change.
0
         """
0
         from django.contrib.auth.views import password_change_done
0
-        return password_change_done(request)
0
+        return password_change_done(request,
0
+            template_name=self.password_change_done_template or 'registration/password_change_done.html'
0
+        )
0
 
0
     def i18n_javascript(self, request):
0
         """
0
@@ -211,7 +218,9 @@ class AdminSite(object):
0
         This should *not* assume the user is already logged in.
0
         """
0
         from django.contrib.auth.views import logout
0
-        return logout(request)
0
+        return logout(request,
0
+            template_name=self.logout_template or 'registration/logged_out.html'
0
+        )
0
     logout = never_cache(logout)
0
 
0
     def login(self, request):
...
16
17
18
 
 
19
20
21
...
60
61
62
63
 
64
65
66
...
92
93
94
95
 
96
97
98
...
16
17
18
19
20
21
22
23
...
62
63
64
 
65
66
67
68
...
94
95
96
 
97
98
99
100
0
@@ -16,6 +16,8 @@ class GroupAdmin(admin.ModelAdmin):
0
     filter_horizontal = ('permissions',)
0
 
0
 class UserAdmin(admin.ModelAdmin):
0
+    add_form_template = None
0
+    change_user_password_template = None
0
     fieldsets = (
0
         (None, {'fields': ('username', 'password')}),
0
         (_('Personal info'), {'fields': ('first_name', 'last_name', 'email')}),
0
@@ -60,7 +62,7 @@ class UserAdmin(admin.ModelAdmin):
0
                     return HttpResponseRedirect('../%s/' % new_user.id)
0
         else:
0
             form = self.add_form()
0
-        return render_to_response('admin/auth/user/add_form.html', {
0
+        return render_to_response(self.add_form_template or 'admin/auth/user/add_form.html', {
0
             'title': _('Add user'),
0
             'form': form,
0
             'is_popup': '_popup' in request.REQUEST,
0
@@ -92,7 +94,7 @@ class UserAdmin(admin.ModelAdmin):
0
                 return HttpResponseRedirect('..')
0
         else:
0
             form = self.change_password_form(user)
0
-        return render_to_response('admin/auth/user/change_password.html', {
0
+        return render_to_response(self.change_user_password_template or 'admin/auth/user/change_password.html', {
0
             'title': _('Change password: %s') % escape(user.username),
0
             'form': form,
0
             'is_popup': '_popup' in request.REQUEST,

Comments