Merge pull request #21616 from open-craft/samuel/gate-change-password

SE-1496 conditionally re-enable user change password form in admin
This commit is contained in:
David Ormsbee
2020-02-21 11:03:06 -05:00
committed by GitHub
5 changed files with 49 additions and 11 deletions

View File

@@ -329,6 +329,19 @@ FEATURES = {
'SHOW_FOOTER_LANGUAGE_SELECTOR': False,
'ENABLE_ENROLLMENT_RESET': False,
'DISABLE_MOBILE_COURSE_AVAILABLE': False,
# .. toggle_name: ENABLE_CHANGE_USER_PASSWORD_ADMIN
# .. toggle_implementation: DjangoSetting
# .. toggle_default: False
# .. toggle_description: Set to True to enable changing a user password through django admin. This is disabled by default because enabling allows a method to bypass password policy.
# .. toggle_category: admin
# .. toggle_use_cases: open_edx
# .. toggle_creation_date: 2020-02-21
# .. toggle_expiration_date: None
# .. toggle_tickets: 'https://github.com/edx/edx-platform/pull/21616'
# .. toggle_status: supported
# .. toggle_warnings: None
'ENABLE_CHANGE_USER_PASSWORD_ADMIN': False,
}
ENABLE_JASMINE = False

View File

@@ -215,8 +215,9 @@ if settings.FEATURES.get('ENABLE_SERVICE_STATUS'):
# The password pages in the admin tool are disabled so that all password
# changes go through our user portal and follow complexity requirements.
if not settings.FEATURES.get('ENABLE_CHANGE_USER_PASSWORD_ADMIN'):
urlpatterns.append(url(r'^admin/auth/user/\d+/password/$', handler404))
urlpatterns.append(url(r'^admin/password_change/$', handler404))
urlpatterns.append(url(r'^admin/auth/user/\d+/password/$', handler404))
urlpatterns.append(url(r'^admin/', admin.site.urls))
# enable entrance exams