Skip to content

Commit

Permalink
Merge branch 'master' into transifex-bot-update-translations2023-11-12
Browse files Browse the repository at this point in the history
  • Loading branch information
syedsajjadkazmii authored Nov 14, 2023
2 parents 37e73e5 + 4466497 commit 79495b1
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions src/register/data/utils.js
Original file line number Diff line number Diff line change
@@ -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';
Expand Down Expand Up @@ -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']);
Expand Down

0 comments on commit 79495b1

Please sign in to comment.