diff --git a/cms/static/js/factories/settings.js b/cms/static/js/factories/settings.js index f8f927287c64..472f3c874e9e 100644 --- a/cms/static/js/factories/settings.js +++ b/cms/static/js/factories/settings.js @@ -3,7 +3,7 @@ define([ ], function($, CourseDetailsModel, MainView) { 'use strict'; - return function(detailsUrl, showMinGradeWarning, showCertificateAvailableDate, upgradeDeadline, useV2CertDisplaySettings) { + return function(detailsUrl, showMinGradeWarning, showCertificateAvailableDate, upgradeDeadline) { var model; // highlighting labels when fields are focused in $('form :input') @@ -23,7 +23,6 @@ define([ model = new CourseDetailsModel(); model.urlRoot = detailsUrl; model.showCertificateAvailableDate = showCertificateAvailableDate; - model.useV2CertDisplaySettings = useV2CertDisplaySettings; model.set('upgrade_deadline', upgradeDeadline); model.fetch({ // eslint-disable-next-line no-shadow @@ -33,7 +32,6 @@ define([ model: model, showMinGradeWarning: showMinGradeWarning }); - editor.useV2CertDisplaySettings = useV2CertDisplaySettings; editor.render(); }, reset: true, diff --git a/cms/static/js/models/settings/course_details.js b/cms/static/js/models/settings/course_details.js index 302f214fd6ea..1714436d7d32 100644 --- a/cms/static/js/models/settings/course_details.js +++ b/cms/static/js/models/settings/course_details.js @@ -84,35 +84,33 @@ function(Backbone, _, gettext, ValidationHelpers, DateUtils, StringUtils) { ); } - if (this.useV2CertDisplaySettings) { - if ( - newattrs.certificates_display_behavior - && !(Object.values(CERTIFICATES_DISPLAY_BEHAVIOR_OPTIONS).includes(newattrs.certificates_display_behavior)) - ) { - errors.certificates_display_behavior = StringUtils.interpolate( - gettext( - 'The certificate display behavior must be one of: {behavior_options}' - ), - { - behavior_options: Object.values(CERTIFICATES_DISPLAY_BEHAVIOR_OPTIONS).join(', ') - } - ); - } + if ( + newattrs.certificates_display_behavior + && !(Object.values(CERTIFICATES_DISPLAY_BEHAVIOR_OPTIONS).includes(newattrs.certificates_display_behavior)) + ) { + errors.certificates_display_behavior = StringUtils.interpolate( + gettext( + 'The certificate display behavior must be one of: {behavior_options}' + ), + { + behavior_options: Object.values(CERTIFICATES_DISPLAY_BEHAVIOR_OPTIONS).join(', ') + } + ); + } - // Throw error if there's a value for certificate_available_date - if ( - (newattrs.certificate_available_date && newattrs.certificates_display_behavior != CERTIFICATES_DISPLAY_BEHAVIOR_OPTIONS.END_WITH_DATE) - || (!newattrs.certificate_available_date && newattrs.certificates_display_behavior == CERTIFICATES_DISPLAY_BEHAVIOR_OPTIONS.END_WITH_DATE) - ) { - errors.certificates_display_behavior = StringUtils.interpolate( - gettext( - 'The certificates display behavior must be {valid_option} if certificate available date is set.' - ), - { - valid_option: CERTIFICATES_DISPLAY_BEHAVIOR_OPTIONS.END_WITH_DATE - } - ); - } + // Throw error if there's a value for certificate_available_date + if ( + (newattrs.certificate_available_date && newattrs.certificates_display_behavior != CERTIFICATES_DISPLAY_BEHAVIOR_OPTIONS.END_WITH_DATE) + || (!newattrs.certificate_available_date && newattrs.certificates_display_behavior == CERTIFICATES_DISPLAY_BEHAVIOR_OPTIONS.END_WITH_DATE) + ) { + errors.certificates_display_behavior = StringUtils.interpolate( + gettext( + 'The certificates display behavior must be {valid_option} if certificate available date is set.' + ), + { + valid_option: CERTIFICATES_DISPLAY_BEHAVIOR_OPTIONS.END_WITH_DATE + } + ); } if (newattrs.intro_video && newattrs.intro_video !== this.get('intro_video')) {