Ticket #4450: user_change_password.patch
File user_change_password.patch, 1.6 KB (added by , 17 years ago) |
---|
-
django/contrib/admin/sites.py
9 9 import cPickle as pickle 10 10 import datetime 11 11 import md5 12 import re 12 13 13 14 ERROR_MESSAGE = ugettext_lazy("Please enter a correct username and password. Note that both fields are case-sensitive.") 14 15 LOGIN_FORM_KEY = 'this_is_the_login_form' … … 110 111 111 112 if not self.has_permission(request): 112 113 return self.login(request) 114 115 user_change_password = re.compile('auth/user/(\d+)/password') 113 116 114 117 if url == '': 115 118 return self.index(request) … … 119 122 return self.password_change_done(request) 120 123 elif url == 'jsi18n': 121 124 return self.i18n_javascript(request) 125 elif user_change_password.match(url): 126 m = user_change_password.match(url) 127 return self.user_change_password(request, m.group(1)) 122 128 elif '/' in url: 123 129 return self.model_page(request, *url.split('/', 2)) 124 130 … … 153 159 from django.contrib.auth.views import password_change_done 154 160 return password_change_done(request) 155 161 162 def user_change_password(self, request, id): 163 """ 164 Handles the "user change password" task 165 """ 166 from django.contrib.admin.views.auth import user_change_password 167 return user_change_password(request, id) 168 156 169 def i18n_javascript(self, request): 157 170 """ 158 171 Displays the i18n JavaScript that the Django admin requires.