Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
E
edx-platform
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
edx
edx-platform
Commits
04da157e
Commit
04da157e
authored
Aug 23, 2017
by
Ayub khan
Committed by
GitHub
Aug 23, 2017
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #15861 from edx/LEARNER-174
LEARNER-174 Make country label and error message more user friendly
parents
6e607fcc
e737728c
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
33 additions
and
22 deletions
+33
-22
common/test/acceptance/tests/lms/test_account_settings.py
+2
-2
common/test/acceptance/tests/lms/test_lms.py
+1
-1
lms/static/js/student_account/views/account_settings_factory.js
+3
-2
openedx/core/djangoapps/user_api/accounts/__init__.py
+7
-7
openedx/core/djangoapps/user_api/api.py
+9
-1
openedx/core/djangoapps/user_api/tests/test_views.py
+11
-9
No files found.
common/test/acceptance/tests/lms/test_account_settings.py
View file @
04da157e
...
...
@@ -165,7 +165,7 @@ class AccountSettingsPageTest(AccountSettingsTestMixin, AcceptanceTest):
'Email Address'
,
'Password'
,
'Language'
,
'Country or Region'
,
'Country or Region
of Residence
'
,
'Time Zone'
,
]
},
...
...
@@ -410,7 +410,7 @@ class AccountSettingsPageTest(AccountSettingsTestMixin, AcceptanceTest):
"""
self
.
_test_dropdown_field
(
u'country'
,
u'Country or Region'
,
u'Country or Region
of Residence
'
,
u''
,
[
u'Pakistan'
,
u'Palau'
],
)
...
...
common/test/acceptance/tests/lms/test_lms.py
View file @
04da157e
...
...
@@ -345,7 +345,7 @@ class RegisterFromCombinedPageTest(UniqueCourseTest):
errors
=
self
.
register_page
.
wait_for_errors
()
self
.
assertIn
(
u'Please enter your Public Username.'
,
errors
)
self
.
assertIn
(
u'You must agree to the édX Terms of Service and Honor Code'
,
errors
)
self
.
assertIn
(
u'
Please select your Country
.'
,
errors
)
self
.
assertIn
(
u'
Select your country or region of residence
.'
,
errors
)
self
.
assertIn
(
u'Please tell us your favorite movie.'
,
errors
)
def
test_toggle_to_login_form
(
self
):
...
...
lms/static/js/student_account/views/account_settings_factory.js
View file @
04da157e
...
...
@@ -124,10 +124,11 @@
view
:
new
AccountSettingsFieldViews
.
DropdownFieldView
({
model
:
userAccountModel
,
required
:
true
,
title
:
gettext
(
'Country or Region'
),
title
:
gettext
(
'Country or Region
of Residence
'
),
valueAttribute
:
'country'
,
options
:
fieldsData
.
country
.
options
,
persistChanges
:
true
persistChanges
:
true
,
helpMessage
:
gettext
(
'The country or region where you live.'
)
})
},
{
...
...
openedx/core/djangoapps/user_api/accounts/__init__.py
View file @
04da157e
...
...
@@ -66,7 +66,7 @@ USERNAME_BAD_LENGTH_MSG = _(u"Username must be between {min} and {max} character
EMAIL_BAD_LENGTH_MSG
=
_
(
u"Enter a valid email address that contains at least {min} characters."
)
.
format
(
min
=
EMAIL_MIN_LENGTH
)
PASSWORD_EMPTY_MSG
=
_
(
u"
Please e
nter a password."
)
PASSWORD_EMPTY_MSG
=
_
(
u"
E
nter a password."
)
PASSWORD_BAD_MIN_LENGTH_MSG
=
_
(
u"Password is not long enough."
)
PASSWORD_BAD_MAX_LENGTH_MSG
=
_
(
u"Password cannot be longer than {max} character."
)
.
format
(
max
=
PASSWORD_MAX_LENGTH
)
...
...
@@ -81,10 +81,10 @@ PASSWORD_CANT_EQUAL_USERNAME_MSG = _(u"Password cannot be the same as the userna
# Translators: These messages are shown to users who do not enter information
# into the required field or enter it incorrectly.
REQUIRED_FIELD_NAME_MSG
=
_
(
u"
Please enter your Full N
ame."
)
REQUIRED_FIELD_NAME_MSG
=
_
(
u"
Enter your full n
ame."
)
REQUIRED_FIELD_CONFIRM_EMAIL_MSG
=
_
(
u"The email addresses do not match."
)
REQUIRED_FIELD_COUNTRY_MSG
=
_
(
u"
Please select your Country
."
)
REQUIRED_FIELD_CITY_MSG
=
_
(
u"
Please enter your C
ity."
)
REQUIRED_FIELD_GOALS_MSG
=
_
(
u"
Please t
ell us your goals."
)
REQUIRED_FIELD_LEVEL_OF_EDUCATION_MSG
=
_
(
u"
Please select your highest level of education
completed."
)
REQUIRED_FIELD_MAILING_ADDRESS_MSG
=
_
(
u"
Please e
nter your mailing address."
)
REQUIRED_FIELD_COUNTRY_MSG
=
_
(
u"
Select your country or region of residence
."
)
REQUIRED_FIELD_CITY_MSG
=
_
(
u"
Enter your c
ity."
)
REQUIRED_FIELD_GOALS_MSG
=
_
(
u"
T
ell us your goals."
)
REQUIRED_FIELD_LEVEL_OF_EDUCATION_MSG
=
_
(
u"
Select the highest level of education you have
completed."
)
REQUIRED_FIELD_MAILING_ADDRESS_MSG
=
_
(
u"
E
nter your mailing address."
)
openedx/core/djangoapps/user_api/api.py
View file @
04da157e
...
...
@@ -633,7 +633,14 @@ class RegistrationFormFactory(object):
"""
# Translators: This label appears above a dropdown menu on the registration
# form used to select the country in which the user lives.
country_label
=
_
(
u"Country"
)
country_label
=
_
(
u"Country or Region of Residence"
)
country_instructions
=
_
(
# Translators: These instructions appear on the registration form, immediately
# below a field meant to hold the user's country.
u"The country or region where you live."
)
error_msg
=
accounts
.
REQUIRED_FIELD_COUNTRY_MSG
# If we set a country code, make sure it's uppercase for the sake of the form.
...
...
@@ -647,6 +654,7 @@ class RegistrationFormFactory(object):
form_desc
.
add_field
(
"country"
,
label
=
country_label
,
instructions
=
country_instructions
,
field_type
=
"select"
,
options
=
list
(
countries
),
include_default_option
=
True
,
...
...
openedx/core/djangoapps/user_api/tests/test_views.py
View file @
04da157e
...
...
@@ -1165,14 +1165,15 @@ class RegistrationViewTest(ThirdPartyAuthTestMixin, UserAPITestCase):
self
.
_assert_reg_field
(
{
u"country"
:
u"required"
},
{
u"label"
:
u"Country"
,
u"label"
:
u"Country
or Region of Residence
"
,
u"name"
:
u"country"
,
u"defaultValue"
:
expected_country_code
,
u"type"
:
u"select"
,
u"required"
:
True
,
u"options"
:
country_options
,
u"instructions"
:
u"The country or region where you live."
,
u"errorMessages"
:
{
u"required"
:
u"
Please select your Country
."
u"required"
:
u"
Select your country or region of residence
."
},
}
)
...
...
@@ -1198,7 +1199,7 @@ class RegistrationViewTest(ThirdPartyAuthTestMixin, UserAPITestCase):
{
"value"
:
"other"
,
"name"
:
"Other education"
,
"default"
:
False
},
],
"errorMessages"
:
{
"required"
:
"
Please select your highest level of education
completed."
"required"
:
"
Select the highest level of education you have
completed."
}
}
)
...
...
@@ -1227,7 +1228,7 @@ class RegistrationViewTest(ThirdPartyAuthTestMixin, UserAPITestCase):
{
"value"
:
"other"
,
"name"
:
"Other education TRANSLATED"
,
"default"
:
False
},
],
"errorMessages"
:
{
"required"
:
"
Please select your highest level of education
completed."
"required"
:
"
Select the highest level of education you have
completed."
}
}
)
...
...
@@ -1307,7 +1308,7 @@ class RegistrationViewTest(ThirdPartyAuthTestMixin, UserAPITestCase):
"required"
:
False
,
"label"
:
"Mailing address"
,
"errorMessages"
:
{
"required"
:
"
Please e
nter your mailing address."
"required"
:
"
E
nter your mailing address."
}
}
)
...
...
@@ -1323,7 +1324,7 @@ class RegistrationViewTest(ThirdPartyAuthTestMixin, UserAPITestCase):
platform_name
=
settings
.
PLATFORM_NAME
),
"errorMessages"
:
{
"required"
:
"
Please t
ell us your goals."
"required"
:
"
T
ell us your goals."
}
}
)
...
...
@@ -1337,7 +1338,7 @@ class RegistrationViewTest(ThirdPartyAuthTestMixin, UserAPITestCase):
"required"
:
False
,
"label"
:
"City"
,
"errorMessages"
:
{
"required"
:
"
Please enter your C
ity."
"required"
:
"
Enter your c
ity."
}
}
)
...
...
@@ -1373,13 +1374,14 @@ class RegistrationViewTest(ThirdPartyAuthTestMixin, UserAPITestCase):
self
.
_assert_reg_field
(
{
"country"
:
"required"
},
{
"label"
:
"Country"
,
"label"
:
"Country
or Region of Residence
"
,
"name"
:
"country"
,
"type"
:
"select"
,
"instructions"
:
"The country or region where you live."
,
"required"
:
True
,
"options"
:
country_options
,
"errorMessages"
:
{
"required"
:
"
Please select your Country
."
"required"
:
"
Select your country or region of residence
."
},
}
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment