Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 17 additions & 17 deletions openedx/core/djangoapps/user_api/accounts/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 = _(
Expand Down
2 changes: 1 addition & 1 deletion openedx/core/djangoapps/user_authn/api/helper.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down
6 changes: 3 additions & 3 deletions openedx/core/djangoapps/user_authn/api/tests/test_views.py
Original file line number Diff line number Diff line change
Expand Up @@ -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'] == {}
Expand All @@ -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']
Expand Down Expand Up @@ -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']
Expand Down
2 changes: 1 addition & 1 deletion openedx/core/djangoapps/user_authn/api/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -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': {},
Expand Down
24 changes: 12 additions & 12 deletions openedx/core/djangoapps/user_authn/views/tests/test_register.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"
},
}
)
Expand All @@ -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"
}
}
)
Expand Down Expand Up @@ -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"
}
}
)
Expand Down Expand Up @@ -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"
}
}
)
Expand All @@ -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"
},
}
)
Expand All @@ -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"
}
}
)
Expand All @@ -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"
},
}
)
Expand All @@ -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"
}
}
)
Expand All @@ -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"
}
}
)
Expand All @@ -1087,7 +1087,7 @@ def test_registration_form_city(self):
"required": False,
"label": "City",
"errorMessages": {
"required": "Enter your city."
"required": "Enter your city"
}
}
)
Expand Down Expand Up @@ -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"
},
}
)
Expand Down Expand Up @@ -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",
}
}
)
Expand Down