Skip to content

Commit

Permalink
feat: enable custom_reg_form capability (#256)
Browse files Browse the repository at this point in the history
The capability could be used enabled using the `REGISTRATION_EXTENSION_FORM` setting.

This is a feature of upstream openedx, the platform has that capability of registration
extension models and maybe for people like opencraft would like.

refs: #253
  • Loading branch information
johanseto authored Jan 12, 2024
1 parent 7e4d9d2 commit 05f2756
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 05f2756

Please sign in to comment.