diff --git a/cms/urls.py b/cms/urls.py index 0694b48a83..44e223b3a6 100644 --- a/cms/urls.py +++ b/cms/urls.py @@ -23,6 +23,11 @@ admin.site.site_title = admin.site.site_header if password_policy_compliance.should_enforce_compliance_on_login(): admin.site.login_form = PasswordPolicyAwareAdminAuthForm +# Custom error pages +# These are used by Django to render these error codes. Do not remove. +# pylint: disable=invalid-name +handler404 = contentstore.views.render_404 +handler500 = contentstore.views.render_500 # Pattern to match a course key or a library key COURSELIKE_KEY_PATTERN = r'(?P({}|{}))'.format( @@ -200,7 +205,10 @@ if settings.FEATURES.get('AUTH_USE_CAS'): url(r'^cas-auth/login/$', openedx.core.djangoapps.external_auth.views.cas_login, name="cas-login"), url(r'^cas-auth/logout/$', django_cas.views.logout, {'next_page': '/'}, name="cas-logout"), ] - +# The password pages in the admin tool are disabled so that all password +# changes go through our user portal and follow complexity requirements. +urlpatterns.append(url(r'^admin/password_change/$', handler404)) +urlpatterns.append(url(r'^admin/auth/user/\d+/password/$', handler404)) urlpatterns.append(url(r'^admin/', include(admin.site.urls))) # enable entrance exams @@ -257,12 +265,6 @@ if 'debug_toolbar' in settings.INSTALLED_APPS: urlpatterns.append(url(r'^template/(?P