diff --git a/openedx/core/djangoapps/user_api/accounts/__init__.py b/openedx/core/djangoapps/user_api/accounts/__init__.py index 301adf98898a..b36f2cce68d9 100644 --- a/openedx/core/djangoapps/user_api/accounts/__init__.py +++ b/openedx/core/djangoapps/user_api/accounts/__init__.py @@ -88,29 +88,29 @@ ) # These strings are normally not user-facing. -USERNAME_BAD_TYPE_MSG = "Username must be a string." -EMAIL_BAD_TYPE_MSG = "Email must be a string." -PASSWORD_BAD_TYPE_MSG = "Password must be a string." +USERNAME_BAD_TYPE_MSG = "Username must be a string" +EMAIL_BAD_TYPE_MSG = "Email must be a string" +PASSWORD_BAD_TYPE_MSG = "Password must be a string" # Translators: These messages are shown to users who do not enter information # into the required field or enter it incorrectly. -REQUIRED_FIELD_NAME_MSG = _("Enter your full name.") -REQUIRED_FIELD_FIRST_NAME_MSG = _("Enter your first name.") -REQUIRED_FIELD_LAST_NAME_MSG = _("Enter your last name.") -REQUIRED_FIELD_CONFIRM_EMAIL_MSG = _("The email addresses do not match.") +REQUIRED_FIELD_NAME_MSG = _("Enter your full name") +REQUIRED_FIELD_FIRST_NAME_MSG = _("Enter your first name") +REQUIRED_FIELD_LAST_NAME_MSG = _("Enter your last name") +REQUIRED_FIELD_CONFIRM_EMAIL_MSG = _("The email addresses do not match") REQUIRED_FIELD_CONFIRM_EMAIL_TEXT_MSG = _("Enter your confirm email") -REQUIRED_FIELD_COUNTRY_MSG = _("Select your country or region of residence.") -REQUIRED_FIELD_PROFESSION_SELECT_MSG = _("Select your profession.") -REQUIRED_FIELD_SPECIALTY_SELECT_MSG = _("Select your specialty.") -REQUIRED_FIELD_PROFESSION_TEXT_MSG = _("Enter your profession.") -REQUIRED_FIELD_SPECIALTY_TEXT_MSG = _("Enter your specialty.") -REQUIRED_FIELD_STATE_MSG = _("Enter your state.") -REQUIRED_FIELD_CITY_MSG = _("Enter your city.") -REQUIRED_FIELD_GOALS_MSG = _("Tell us your goals.") -REQUIRED_FIELD_LEVEL_OF_EDUCATION_MSG = _("Select the highest level of education you have completed.") +REQUIRED_FIELD_COUNTRY_MSG = _("Select your country or region of residence") +REQUIRED_FIELD_PROFESSION_SELECT_MSG = _("Select your profession") +REQUIRED_FIELD_SPECIALTY_SELECT_MSG = _("Select your specialty") +REQUIRED_FIELD_PROFESSION_TEXT_MSG = _("Enter your profession") +REQUIRED_FIELD_SPECIALTY_TEXT_MSG = _("Enter your specialty") +REQUIRED_FIELD_STATE_MSG = _("Enter your state") +REQUIRED_FIELD_CITY_MSG = _("Enter your city") +REQUIRED_FIELD_GOALS_MSG = _("Tell us your goals") +REQUIRED_FIELD_LEVEL_OF_EDUCATION_MSG = _("Select the highest level of education you have completed") REQUIRED_FIELD_YEAR_OF_BIRTH_MSG = _("Select your year of birth") REQUIRED_FIELD_GENDER_MSG = _("Select your gender") -REQUIRED_FIELD_MAILING_ADDRESS_MSG = _("Enter your mailing address.") +REQUIRED_FIELD_MAILING_ADDRESS_MSG = _("Enter your mailing address") # HIBP Strings AUTHN_LOGIN_BLOCK_HIBP_POLICY_MSG = _( diff --git a/openedx/core/djangoapps/user_authn/api/helper.py b/openedx/core/djangoapps/user_authn/api/helper.py index 5a1762172e53..55c38dd4d77a 100644 --- a/openedx/core/djangoapps/user_authn/api/helper.py +++ b/openedx/core/djangoapps/user_authn/api/helper.py @@ -93,7 +93,7 @@ def _field_can_be_saved(self, field): only stores those fields which are available in extended_profile configuration, so we only want to send those fields which can be saved. """ - return (field in self.user_profile_fields or + return (field in self.user_profile_fields or field in ["terms_of_service", "honor_code"] or field in configuration_helpers.get_value('extended_profile_fields', [])) def _get_fields(self): diff --git a/openedx/core/djangoapps/user_authn/api/tests/test_views.py b/openedx/core/djangoapps/user_authn/api/tests/test_views.py index 88ae19cc4295..f7acaeb69207 100644 --- a/openedx/core/djangoapps/user_authn/api/tests/test_views.py +++ b/openedx/core/djangoapps/user_authn/api/tests/test_views.py @@ -197,7 +197,7 @@ def test_required_fields_not_configured(self): Test that when no required fields are configured in REGISTRATION_EXTRA_FIELDS settings, then API returns proper response. """ - self.query_params.update({'is_registered': True}) + self.query_params.update({'is_register_page': True}) response = self.client.get(self.url, self.query_params) assert response.status_code == status.HTTP_200_OK assert response.data['registration_fields']['fields'] == {} @@ -216,7 +216,7 @@ def test_required_field_order(self): """ Test that order of required fields """ - self.query_params.update({'is_registered': True}) + self.query_params.update({'is_register_page': True}) response = self.client.get(self.url, self.query_params) assert response.status_code == status.HTTP_200_OK assert list(response.data['registration_fields']['fields'].keys()) == ['first_name', 'last_name', 'state'] @@ -311,7 +311,7 @@ def test_field_not_available_in_extended_profile_config(self): Test that if the field is not available in extended_profile configuration then the field will not be sent in response. """ - self.query_params.update({'is_registered': True}) + self.query_params.update({'is_register_page': True}) response = self.client.get(self.url, self.query_params) assert response.status_code == status.HTTP_200_OK assert list(response.data['registration_fields']['fields'].keys()) == ['specialty'] diff --git a/openedx/core/djangoapps/user_authn/api/views.py b/openedx/core/djangoapps/user_authn/api/views.py index 93f37a1a267d..63e1d2fb3a06 100644 --- a/openedx/core/djangoapps/user_authn/api/views.py +++ b/openedx/core/djangoapps/user_authn/api/views.py @@ -51,7 +51,7 @@ def get(self, request, **kwargs): # lint-amnesty, pylint: disable=unused-argume request_params = request.GET redirect_to = get_next_url_for_login_page(request) third_party_auth_hint = request_params.get('tpa_hint') - is_register_page = request_params.get('is_registered') + is_register_page = request_params.get('is_register_page') context = { 'context_data': get_mfe_context(request, redirect_to, third_party_auth_hint), 'registration_fields': {}, diff --git a/openedx/core/djangoapps/user_authn/views/tests/test_register.py b/openedx/core/djangoapps/user_authn/views/tests/test_register.py index 19b3dc51dc27..1ca7d1ce55d8 100644 --- a/openedx/core/djangoapps/user_authn/views/tests/test_register.py +++ b/openedx/core/djangoapps/user_authn/views/tests/test_register.py @@ -836,7 +836,7 @@ def test_register_form_third_party_auth_running_google(self, input_country_code, "options": country_options, "instructions": "The country or region where you live.", "errorMessages": { - "required": "Select your country or region of residence." + "required": "Select your country or region of residence" }, } ) @@ -862,7 +862,7 @@ def test_register_form_level_of_education(self): {"value": "other", "name": "Other education", "default": False}, ], "errorMessages": { - "required": "Select the highest level of education you have completed." + "required": "Select the highest level of education you have completed" } } ) @@ -891,7 +891,7 @@ def test_register_form_level_of_education_translations(self, fake_gettext): {"value": "other", "name": "Other education TRANSLATED", "default": False}, ], "errorMessages": { - "required": "Select the highest level of education you have completed." + "required": "Select the highest level of education you have completed" } } ) @@ -989,7 +989,7 @@ def test_register_form_profession_without_profession_options(self): "required": True, "label": "Profession", "errorMessages": { - "required": "Enter your profession." + "required": "Enter your profession" } } ) @@ -1009,7 +1009,7 @@ def test_register_form_profession_with_profession_options(self): "label": "Profession", "options": self.PROFESSION_OPTIONS, "errorMessages": { - "required": "Select your profession." + "required": "Select your profession" }, } ) @@ -1023,7 +1023,7 @@ def test_register_form_specialty_without_specialty_options(self): "required": True, "label": "Specialty", "errorMessages": { - "required": "Enter your specialty." + "required": "Enter your specialty" } } ) @@ -1043,7 +1043,7 @@ def test_register_form_specialty_with_specialty_options(self): "label": "Specialty", "options": self.SPECIALTY_OPTIONS, "errorMessages": { - "required": "Select your specialty." + "required": "Select your specialty" }, } ) @@ -1057,7 +1057,7 @@ def test_registration_form_mailing_address(self): "required": False, "label": "Mailing address", "errorMessages": { - "required": "Enter your mailing address." + "required": "Enter your mailing address" } } ) @@ -1073,7 +1073,7 @@ def test_registration_form_goals(self): platform_name=settings.PLATFORM_NAME ), "errorMessages": { - "required": "Tell us your goals." + "required": "Tell us your goals" } } ) @@ -1087,7 +1087,7 @@ def test_registration_form_city(self): "required": False, "label": "City", "errorMessages": { - "required": "Enter your city." + "required": "Enter your city" } } ) @@ -1130,7 +1130,7 @@ def test_registration_form_country(self): "required": True, "options": country_options, "errorMessages": { - "required": "Select your country or region of residence." + "required": "Select your country or region of residence" }, } ) @@ -2193,7 +2193,7 @@ def test_registration_form_confirm_email(self): "required": True, "label": "Confirm Email", "errorMessages": { - "required": "The email addresses do not match.", + "required": "The email addresses do not match", } } )