diff --git a/lms/djangoapps/student_account/views.py b/lms/djangoapps/student_account/views.py index 9f83f76228..e679a93f70 100644 --- a/lms/djangoapps/student_account/views.py +++ b/lms/djangoapps/student_account/views.py @@ -427,12 +427,13 @@ def _get_extended_profile_fields(): "state": _(u"State/Province/Region"), "company": _(u"Company"), "title": _(u"Title"), + "job_title": _(u"Job Title"), "mailing_address": _(u"Mailing address"), "goals": _(u"Tell us why you're interested in {platform_name}").format( platform_name=configuration_helpers.get_value("PLATFORM_NAME", settings.PLATFORM_NAME) ), - "profession": _("Profession"), - "specialty": _("Specialty") + "profession": _(u"Profession"), + "specialty": _(u"Specialty") } extended_profile_field_names = configuration_helpers.get_value('extended_profile_fields', []) diff --git a/openedx/core/djangoapps/user_api/api.py b/openedx/core/djangoapps/user_api/api.py index a7c51ffd48..b8d68113fb 100644 --- a/openedx/core/djangoapps/user_api/api.py +++ b/openedx/core/djangoapps/user_api/api.py @@ -144,6 +144,7 @@ class RegistrationFormFactory(object): "year_of_birth", "level_of_education", "company", + "job_title", "title", "mailing_address", "goals", @@ -652,6 +653,23 @@ class RegistrationFormFactory(object): required=required ) + def _add_job_title_field(self, form_desc, required=False): + """Add a Job Title field to a form description. + Arguments: + form_desc: A form description + Keyword Arguments: + required (bool): Whether this field is required; defaults to False + """ + # Translators: This label appears above a field on the registration form + # which allows the user to input the Job Title + job_title_label = _(u"Job Title") + + form_desc.add_field( + "job_title", + label=job_title_label, + required=required + ) + def _add_first_name_field(self, form_desc, required=False): """Add a First Name field to a form description. Arguments: diff --git a/openedx/core/djangoapps/user_api/tests/test_views.py b/openedx/core/djangoapps/user_api/tests/test_views.py index b2fcbb8c05..fbbfa638f1 100644 --- a/openedx/core/djangoapps/user_api/tests/test_views.py +++ b/openedx/core/djangoapps/user_api/tests/test_views.py @@ -1731,6 +1731,7 @@ class RegistrationViewTest(ThirdPartyAuthTestMixin, UserAPITestCase): "level_of_education", "company", "title", + "job_title", "mailing_address", "goals", "honor_code",