eduNEXT / eox-core

eox-core is a plugin to extend the core functionality in Open edX
GNU Affero General Public License v3.0
15 stars 9 forks source link

feat: enable custom_reg_form capability #253

Closed johanseto closed 12 months ago

johanseto commented 12 months ago

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

andrey-canon commented 12 months ago

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

https://github.com/eduNEXT/eox-core/assets/36200299/d39c4481-b248-419c-bb27-5f27f6837f12

johanseto commented 12 months ago

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

https://github.com/eduNEXT/eox-core/assets/36200299/d39c4481-b248-419c-bb27-5f27f6837f12

@andrey-canon do you have this setting? REGISTRATION_EXTENSION_FORM

andrey-canon commented 12 months ago

REGISTRATION_EXTENSION_FORM

@johanv26 image

johanseto commented 12 months ago

@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'
andrey-canon commented 12 months ago

@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 commented 12 months ago

@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: https://github.com/eduNEXT/eox-core/pull/256