From e11474db6b2dbd334ac771b3ea8e3a192975a000 Mon Sep 17 00:00:00 2001 From: Blue Date: Fri, 1 Mar 2024 12:09:51 +0500 Subject: [PATCH] fix: add country field error message (#34316) Description: Add country field error message in api response VAN-1862 --- openedx/core/djangoapps/user_authn/api/form_fields.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/openedx/core/djangoapps/user_authn/api/form_fields.py b/openedx/core/djangoapps/user_authn/api/form_fields.py index 8bba651f4709..ca001ba3f1b5 100644 --- a/openedx/core/djangoapps/user_authn/api/form_fields.py +++ b/openedx/core/djangoapps/user_authn/api/form_fields.py @@ -346,7 +346,8 @@ def add_country_field(is_field_required=False): to send the field name and whether or not we want to show error message if this field is empty """ - return {'name': 'country', 'error_message': is_field_required} + error_msg = accounts.REQUIRED_FIELD_COUNTRY_MSG + return {'name': 'country', 'error_message': error_msg if is_field_required else ''} def add_confirm_email_field(is_field_required=False):