Created
January 9, 2015 18:08
-
-
Save hellysmile/97637aa3b9f69d12692f to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def get_urls(self): | |
password_urlpatterns = patterns( | |
'', | |
url( | |
r'^(.+?)/password/$', | |
self.admin_site.admin_view(self.user_change_password) | |
) | |
) | |
base_urlpatterns = super(UserAdmin, self).get_urls() | |
for urlpattern in base_urlpatterns: | |
if '/password/' in urlpattern._regex: | |
password_pattern = urlpattern | |
break | |
base_urlpatterns.remove(password_pattern) | |
urlpatterns = password_urlpatterns + base_urlpatterns | |
return urlpatterns |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment