Skip to content

Commit

Permalink
feat: enable custom_reg_form capability
Browse files Browse the repository at this point in the history
Enable the custom_reg_form.
The field could be used using the `REGISTRATION_EXTENSION_FORM` dict  setting.
https://github.com/openedx/edx-platform/blob/master/openedx/core/djangoapps/user_authn/views/register.py#L205
  • Loading branch information
johanseto committed Nov 16, 2023
1 parent 0fffd5d commit 930d5a1
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions eox_core/edxapp_wrapper/backends/users_m_v1.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@
REGISTER_USER as post_register # pylint: disable=import-error
from openedx.core.djangoapps.user_authn.views.registration_form import ( # pylint: disable=import-error
AccountCreationForm,
get_registration_extension_form,
)
from openedx.core.djangolib.oauth2_retirement_utils import \
retire_dot_oauth2_models # pylint: disable=import-error,unused-import
Expand Down Expand Up @@ -133,9 +134,9 @@ def create_edxapp_user(*args, **kwargs):

# Go ahead and create the new user
with transaction.atomic():
# In theory is possible to extend the registration form with a custom app
# Is possible to extend the registration form with a custom app
# An example form app for this can be found at http://github.com/open-craft/custom-form-app
# form = get_registration_extension_form(data=params)
custom_form = get_registration_extension_form(data=kwargs)
# if not form:
form = EdnxAccountCreationForm(
data=kwargs,
Expand All @@ -144,7 +145,7 @@ def create_edxapp_user(*args, **kwargs):
extended_profile_fields=extended_profile_fields,
# enforce_password_policy=enforce_password_policy,
)
(user, profile, registration) = do_create_account(form) # pylint: disable=unused-variable
(user, profile, registration) = do_create_account(form, custom_form) # pylint: disable=unused-variable

site = kwargs.pop("site", False)
if site:
Expand Down

0 comments on commit 930d5a1

Please sign in to comment.