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 0cc84f8f6674..b498c9778ad9 100644 --- a/lms/static/js/student_account/views/account_settings_factory.js +++ b/lms/static/js/student_account/views/account_settings_factory.js @@ -32,7 +32,8 @@ extendedProfileFields, displayAccountDeletion, isSecondaryEmailFeatureEnabled, - betaLanguage + betaLanguage, + allowFullNameChange ) { var $accountSettingsElement, userAccountModel, userPreferencesModel, aboutSectionsData, accountsSectionData, ordersSectionData, accountSettingsView, showAccountSettingsPage, @@ -104,7 +105,7 @@ helpMessage: gettext('The name that is used for ID verification and that appears on your certificates.'), // eslint-disable-line max-len, persistChanges: true }; - if (syncLearnerProfileData && enterpriseReadonlyAccountFields.fields.indexOf('name') !== -1) { + if (!allowFullNameChange || (syncLearnerProfileData && enterpriseReadonlyAccountFields.fields.indexOf('name') !== -1)) { fullnameFieldView = { view: new AccountSettingsFieldViews.ReadonlyFieldView(fullNameFieldData) }; diff --git a/lms/templates/student_account/account_settings.html b/lms/templates/student_account/account_settings.html index d5418d62f741..a51d45499ead 100644 --- a/lms/templates/student_account/account_settings.html +++ b/lms/templates/student_account/account_settings.html @@ -40,6 +40,7 @@ contactEmail = '${ static.get_contact_email_address() | n, js_escaped_string }', allowEmailChange = ${ bool(settings.FEATURES['ALLOW_EMAIL_ADDRESS_CHANGE']) | n, dump_js_escaped_json }, socialPlatforms = ${ settings.SOCIAL_PLATFORMS | n, dump_js_escaped_json }, + allowFullNameChange = ${ bool(settings.FEATURES.get('ALLOW_FULL_NAME_CHANGE')) | n, dump_js_escaped_json }, syncLearnerProfileData = ${ bool(sync_learner_profile_data) | n, dump_js_escaped_json }, enterpriseName = '${ enterprise_name | n, js_escaped_string }', @@ -74,6 +75,7 @@ displayAccountDeletion, isSecondaryEmailFeatureEnabled, ${ beta_language | n, dump_js_escaped_json }, + allowFullNameChange, );