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

refs: #253
  • Loading branch information
johanseto committed Nov 23, 2023
1 parent 8f3c550 commit e40be4b
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 @@ -39,6 +39,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 @@ -174,12 +175,12 @@ 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=account_creation_form_data["data"])
# if not form:
form = EdnxAccountCreationForm(**account_creation_form_data)
(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 e40be4b

Please sign in to comment.