diff --git a/src/register/data/utils.js b/src/register/data/utils.js index 810360877d..ca060512be 100644 --- a/src/register/data/utils.js +++ b/src/register/data/utils.js @@ -1,4 +1,4 @@ -import { snakeCaseObject } from '@edx/frontend-platform'; +import { getConfig, snakeCaseObject } from '@edx/frontend-platform'; import { LETTER_REGEX, NUMBER_REGEX } from '../../data/constants'; import messages from '../messages'; @@ -44,11 +44,12 @@ export const isFormValid = ( } }); - if (!configurableFormFields?.country?.displayValue) { - fieldErrors.country = formatMessage(messages['empty.country.field.error']); - isValid = false; + if (getConfig().SHOW_CONFIGURABLE_EDX_FIELDS) { + if (!configurableFormFields?.country?.displayValue) { + fieldErrors.country = formatMessage(messages['empty.country.field.error']); + isValid = false; + } } - Object.keys(fieldDescriptions).forEach(key => { if (key === 'country' && !configurableFormFields.country.displayValue) { fieldErrors[key] = formatMessage(messages['empty.country.field.error']);