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
44 changes: 22 additions & 22 deletions openedx/core/djangoapps/user_authn/views/registration_form.py
Original file line number Diff line number Diff line change
Expand Up @@ -315,28 +315,6 @@ class RegistrationFormFactory:

DEFAULT_FIELDS = ["email", "name", "username", "password"]

EXTRA_FIELDS = [
"confirm_email",
"first_name",
"last_name",
"city",
"state",
"country",
"gender",
"year_of_birth",
"level_of_education",
"company",
"job_title",
"title",
"mailing_address",
"goals",
"honor_code",
"terms_of_service",
"profession",
"specialty",
"marketing_emails_opt_in",
]

def _is_field_visible(self, field_name):
"""Check whether a field is visible based on Django settings. """
return self._extra_fields_setting.get(field_name) in ["required", "optional", "optional-exposed"]
Expand All @@ -351,6 +329,28 @@ def _is_field_exposed(self, field_name):

def __init__(self):

self.EXTRA_FIELDS = [
"confirm_email",
"first_name",
"last_name",
"city",
"state",
"country",
"gender",
"year_of_birth",
"level_of_education",
"company",
"job_title",
"title",
"mailing_address",
"goals",
"honor_code",
"terms_of_service",
"profession",
"specialty",
"marketing_emails_opt_in",
]

if settings.ENABLE_COPPA_COMPLIANCE and 'year_of_birth' in self.EXTRA_FIELDS:
self.EXTRA_FIELDS.remove('year_of_birth')

Expand Down
21 changes: 0 additions & 21 deletions openedx/core/djangoapps/user_authn/views/tests/test_register.py
Original file line number Diff line number Diff line change
Expand Up @@ -916,9 +916,6 @@ def test_register_form_gender_translations(self, fake_gettext):
)

def test_register_form_year_of_birth(self):
# WARNING: This test may fail locally due to a test order issue. If it passes on Github,
# but is failing for you locally, you probably did not cause the problem if you
# are not working on registration. See VAN-900 for more details.
this_year = datetime.now(UTC).year
year_options = (
[
Expand Down Expand Up @@ -1305,9 +1302,6 @@ def test_registration_separate_terms_of_service_mktg_site_disabled(self):
REGISTRATION_EXTENSION_FORM='openedx.core.djangoapps.user_api.tests.test_helpers.TestCaseForm',
)
def test_field_order(self):
# WARNING: This test may fail locally due to a test order issue. If it passes on Github,
# but is failing for you locally, you probably did not cause the problem if you
# are not working on registration. See VAN-900 for more details.
response = self.client.get(self.url)
self.assertHttpOK(response)

Expand Down Expand Up @@ -1370,9 +1364,6 @@ def test_field_order(self):
],
)
def test_field_order_override(self):
# WARNING: This test may fail locally due to a test order issue. If it passes on Github,
# but is failing for you locally, you probably did not cause the problem if you
# are not working on registration. See VAN-900 for more details.
response = self.client.get(self.url)
self.assertHttpOK(response)

Expand Down Expand Up @@ -1414,9 +1405,6 @@ def test_field_order_override(self):
],
)
def test_field_order_invalid_override(self):
# WARNING: This test may fail locally due to a test order issue. If it passes on Github,
# but is failing for you locally, you probably did not cause the problem if you
# are not working on registration. See VAN-900 for more details.
response = self.client.get(self.url)
self.assertHttpOK(response)

Expand Down Expand Up @@ -2024,9 +2012,6 @@ def setUp(self): # pylint: disable=arguments-differ
],
)
def test_field_order_invalid_override(self):
# WARNING: This test may fail locally due to a test order issue. If it passes on Github,
# but is failing for you locally, you probably did not cause the problem if you
# are not working on registration. See VAN-900 for more details.
response = self.client.get(self.url)
self.assertHttpOK(response)

Expand Down Expand Up @@ -2091,9 +2076,6 @@ def test_field_order_invalid_override(self):
],
)
def test_field_order_override(self):
# WARNING: This test may fail locally due to a test order issue. If it passes on Github,
# but is failing for you locally, you probably did not cause the problem if you
# are not working on registration. See VAN-900 for more details.
response = self.client.get(self.url)
self.assertHttpOK(response)

Expand Down Expand Up @@ -2122,9 +2104,6 @@ def test_field_order_override(self):
REGISTRATION_EXTENSION_FORM='openedx.core.djangoapps.user_api.tests.test_helpers.TestCaseForm',
)
def test_field_order(self):
# WARNING: This test may fail locally due to a test order issue. If it passes on Github,
# but is failing for you locally, you probably did not cause the problem if you
# are not working on registration. See VAN-900 for more details.
response = self.client.get(self.url)
self.assertHttpOK(response)

Expand Down