diff --git a/common/test/acceptance/tests/lms/test_account_settings.py b/common/test/acceptance/tests/lms/test_account_settings.py index 9ab1139b851330c3d32e3898ff186eeb8b5aa5d1..d3b3c8c0c3a2b942b20f38756ac8bf7259f1cf1d 100644 --- a/common/test/acceptance/tests/lms/test_account_settings.py +++ b/common/test/acceptance/tests/lms/test_account_settings.py @@ -196,7 +196,11 @@ class AccountSettingsPageTest(AccountSettingsTestMixin, AcceptanceTest): 'Facebook Link', 'LinkedIn Link', ] - } + }, + { + 'title': 'Delete My Account', + 'fields': [] + }, ] self.assertEqual(self.account_settings_page.sections_structure(), expected_sections_structure) diff --git a/lms/djangoapps/student_account/views.py b/lms/djangoapps/student_account/views.py index 1a9d0e9dfa0c2aef9c39037ad21e875d98081d94..38f9be8d9944f8b1b2ab86270376db0481450544 100644 --- a/lms/djangoapps/student_account/views.py +++ b/lms/djangoapps/student_account/views.py @@ -568,6 +568,9 @@ def account_settings_context(request): 'show_program_listing': ProgramsApiConfig.is_enabled(), 'show_dashboard_tabs': True, 'order_history': user_orders, + 'enable_account_deletion': configuration_helpers.get_value( + 'ENABLE_ACCOUNT_DELETION', settings.FEATURES.get('ENABLE_ACCOUNT_DELETION', False) + ), 'extended_profile_fields': _get_extended_profile_fields(), } diff --git a/lms/envs/common.py b/lms/envs/common.py index f456bb7ca8ed49ae666b32970d6de77f047c2bd6..338fbe798b73a928eaa595e2231c1e443c00f74f 100644 --- a/lms/envs/common.py +++ b/lms/envs/common.py @@ -402,6 +402,9 @@ FEATURES = { # Set this to true to make API docs available at /api-docs/. 'ENABLE_API_DOCS': False, + + # Whether to display the account deletion section the account settings page + 'ENABLE_ACCOUNT_DELETION': True, } # Settings for the course reviews tool template and identification key, set either to None to disable course reviews diff --git a/lms/static/js/student_account/views/account_settings_factory.js b/lms/static/js/student_account/views/account_settings_factory.js index f1ed9b51923a35a9ed75afd956d212e2184a7d6a..28bb0b8e14ddce5e6f1cb1d41cec97ee58367dc9 100644 --- a/lms/static/js/student_account/views/account_settings_factory.js +++ b/lms/static/js/student_account/views/account_settings_factory.js @@ -27,6 +27,7 @@ enterpriseReadonlyAccountFields, edxSupportUrl, extendedProfileFields, + displayAccountDeletion, enableGDPRFlag ) { var $accountSettingsElement, userAccountModel, userPreferencesModel, aboutSectionsData, @@ -292,7 +293,7 @@ aboutSectionsData.push(socialFields); // Add account deletion fields - if (enableGDPRFlag) { + if (displayAccountDeletion) { accountDeletionFields = { title: gettext('Delete My Account'), fields: [], diff --git a/lms/templates/student_account/account_settings.html b/lms/templates/student_account/account_settings.html index 706c86b3a93eedcbce99bd0f71f9c2d4696e7435..85b57b0ecccd7c35b989f76056ba748b3e852ef3 100644 --- a/lms/templates/student_account/account_settings.html +++ b/lms/templates/student_account/account_settings.html @@ -48,6 +48,7 @@ from openedx.features.course_experience import ENABLE_GDPR_COMPAT_FLAG enterpriseReadonlyAccountFields = ${ enterprise_readonly_account_fields | n, dump_js_escaped_json }, edxSupportUrl = '${ edx_support_url | n, js_escaped_string }', extendedProfileFields = ${ extended_profile_fields | n, dump_js_escaped_json }, + displayAccountDeletion = ${ enable_account_deletion | n, dump_js_escaped_json}; enableGDPRFlag = ${ ENABLE_GDPR_COMPAT_FLAG.is_enabled_without_course_context() | n, dump_js_escaped_json }; AccountSettingsFactory( @@ -68,6 +69,7 @@ from openedx.features.course_experience import ENABLE_GDPR_COMPAT_FLAG enterpriseReadonlyAccountFields, edxSupportUrl, extendedProfileFields, + displayAccountDeletion, enableGDPRFlag ); </%static:require_module>