Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: enable custom_reg_form capability #253

Merged
merged 1 commit into from
Nov 20, 2023

Conversation

johanseto
Copy link
Contributor

@johanseto johanseto commented Nov 16, 2023

Description

Enable the custom_reg_form.
The field could be used using the EDNX_CUSTOM_REGISTRATION_FIELDS setting.
Based in this edx-platform logic

Testing instructions

Add this setting with some fields related to an extended custom reg form.

    "EDNX_CUSTOM_REGISTRATION_FIELDS": [
        {
            "label": "arabicname",
            "name": "arabic_name",
            "type": "text"
        }
    ],

Post a user with the extra_field.
Check the user was created and in the extended custom reg model.

Peek 2023-11-16 14-38

If you add the field is also stored in the model and meta.

   "extended_profile_fields": [
        "arabic_name"
    ]

Peek 2023-11-16 14-46

Additional information

This dont affect anything if you dont have defined the setting REGISTRATION_EXTENSION_FORM.
setting management
Other wise that definition would give the validation rules of that form to the endpoint.
So with with a falsy value, the form works with previous behaviour.
Peek 2023-11-16 14-55

Checklist for Merge

  • Tested in a remote environment
  • Updated documentation
  • Rebased master/main
  • Squashed commits

@johanseto johanseto force-pushed the jlc/enable-custom-reg-form branch from 6dd83eb to 3ac4bef Compare November 16, 2023 20:02
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
@andrey-canon
Copy link
Contributor

@johanv26 this didn't work for me, is something missing ?

2023-11-17.18-28-15.mp4

@johanseto
Copy link
Contributor Author

@johanv26 this didn't work for me, is something missing ?

2023-11-17.18-28-15.mp4

@andrey-canon do you have this setting?
REGISTRATION_EXTENSION_FORM

@andrey-canon
Copy link
Contributor

REGISTRATION_EXTENSION_FORM

@johanv26
image

@johanseto
Copy link
Contributor Author

@andrey-canon I think I had to specify in the PR description how to enable the custom_reg_form.
By the moment, could you add

>>> settings.REGISTRATION_EXTENSION_FORM
'custom_reg_form.forms.ExtraInfoForm'

Copy link
Contributor

@andrey-canon andrey-canon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I tested locally and worked

image
image

@andrey-canon
Copy link
Contributor

andrey-canon commented Nov 20, 2023

@johanv26 could you open the pr against the master branch ? If you haven't done yet

btw I had to change the setting EOX_CORE_USERS_BACKEND since the default is "eox_core.edxapp_wrapper.backends.users_l_v1"

@johanseto johanseto merged commit 7f2d087 into v6.1.0-nelp Nov 20, 2023
1 check passed
@johanseto
Copy link
Contributor Author

@johanv26 could you open the pr against the master branch ? If you haven't done yet

btw I had to change the setting EOX_CORE_USERS_BACKEND since the default is "eox_core.edxapp_wrapper.backends.users_l_v1"

Ok I think that would work by default, but thank you for the explanation.

PR opened:
#256

johanseto added a commit that referenced this pull request Nov 23, 2023
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
johanseto added a commit that referenced this pull request Nov 23, 2023
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
johanseto added a commit that referenced this pull request Nov 23, 2023
The field could be used using the `REGISTRATION_EXTENSION_FORM`  setting.
https://github.com/openedx/edx-platform/blob/master/openedx/core/djangoapps/user_authn/views/register.py#L205
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
johanseto added a commit that referenced this pull request Nov 23, 2023
The capability could be used enabled using the `REGISTRATION_EXTENSION_FORM` setting.
https://github.com/openedx/edx-platform/blob/master/openedx/core/djangoapps/user_authn/views/register.py#L205

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
johanseto added a commit that referenced this pull request Nov 23, 2023
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
MaferMazu pushed a commit that referenced this pull request Jan 12, 2024
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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants