Skip to content

Instantly share code, notes, and snippets.

@hellysmile
Created January 9, 2015 18:08
Show Gist options
  • Save hellysmile/97637aa3b9f69d12692f to your computer and use it in GitHub Desktop.
Save hellysmile/97637aa3b9f69d12692f to your computer and use it in GitHub Desktop.
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