Unverified Commit a4fa04ec by Bessie Steinberg Committed by GitHub

Merge pull request #16931 from edx/bessiesteinberg/WL-1288-registration-page-customization

Add Job Title field to Registration Page
parents c8d0d5eb b340174e
...@@ -433,12 +433,13 @@ def _get_extended_profile_fields(): ...@@ -433,12 +433,13 @@ def _get_extended_profile_fields():
"state": _(u"State/Province/Region"), "state": _(u"State/Province/Region"),
"company": _(u"Company"), "company": _(u"Company"),
"title": _(u"Title"), "title": _(u"Title"),
"job_title": _(u"Job Title"),
"mailing_address": _(u"Mailing address"), "mailing_address": _(u"Mailing address"),
"goals": _(u"Tell us why you're interested in {platform_name}").format( "goals": _(u"Tell us why you're interested in {platform_name}").format(
platform_name=configuration_helpers.get_value("PLATFORM_NAME", settings.PLATFORM_NAME) platform_name=configuration_helpers.get_value("PLATFORM_NAME", settings.PLATFORM_NAME)
), ),
"profession": _("Profession"), "profession": _(u"Profession"),
"specialty": _("Specialty") "specialty": _(u"Specialty")
} }
extended_profile_field_names = configuration_helpers.get_value('extended_profile_fields', []) extended_profile_field_names = configuration_helpers.get_value('extended_profile_fields', [])
......
...@@ -144,6 +144,7 @@ class RegistrationFormFactory(object): ...@@ -144,6 +144,7 @@ class RegistrationFormFactory(object):
"year_of_birth", "year_of_birth",
"level_of_education", "level_of_education",
"company", "company",
"job_title",
"title", "title",
"mailing_address", "mailing_address",
"goals", "goals",
...@@ -652,6 +653,23 @@ class RegistrationFormFactory(object): ...@@ -652,6 +653,23 @@ class RegistrationFormFactory(object):
required=required 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): def _add_first_name_field(self, form_desc, required=False):
"""Add a First Name field to a form description. """Add a First Name field to a form description.
Arguments: Arguments:
......
...@@ -1731,6 +1731,7 @@ class RegistrationViewTest(ThirdPartyAuthTestMixin, UserAPITestCase): ...@@ -1731,6 +1731,7 @@ class RegistrationViewTest(ThirdPartyAuthTestMixin, UserAPITestCase):
"level_of_education", "level_of_education",
"company", "company",
"title", "title",
"job_title",
"mailing_address", "mailing_address",
"goals", "goals",
"honor_code", "honor_code",
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment