diff --git a/lms/envs/common.py b/lms/envs/common.py index 5f8714ca9cf7..fab8daaf081a 100644 --- a/lms/envs/common.py +++ b/lms/envs/common.py @@ -4534,6 +4534,12 @@ def _make_locale_paths(settings): # pylint: disable=missing-function-docstring REGISTRATION_EXTENSION_FORM = None +# .. setting_name: REGISTRATION_EXTENSION_FORM_FIELDS_TPA_OVERRIDES +# .. setting_default: [] +# .. setting_description: List of custom fields included in the registriation +# form extension to be prefilled with third party auth data. +REGISTRATION_EXTENSION_FORM_FIELDS_TPA_OVERRIDES = [] + # Identifier included in the User Agent from open edX mobile apps. MOBILE_APP_USER_AGENT_REGEXES = [ r'edX/org.edx.mobile', diff --git a/openedx/core/djangoapps/user_authn/views/registration_form.py b/openedx/core/djangoapps/user_authn/views/registration_form.py index 1d1089ce0214..eb0c7ce9c3f0 100644 --- a/openedx/core/djangoapps/user_authn/views/registration_form.py +++ b/openedx/core/djangoapps/user_authn/views/registration_form.py @@ -1134,8 +1134,13 @@ def _apply_third_party_auth_overrides(self, request, form_desc): current_provider.skip_registration_form and enterprise_customer_for_request(request) ) or current_provider.sync_learner_profile_data ) + registration_fields = ( + self.DEFAULT_FIELDS + + self.EXTRA_FIELDS + + settings.REGISTRATION_EXTENSION_FORM_FIELDS_TPA_OVERRIDES + ) - for field_name in self.DEFAULT_FIELDS + self.EXTRA_FIELDS: + for field_name in registration_fields: if field_name in field_overrides: form_desc.override_field_properties( field_name, default=field_overrides[field_name]