Update docs: Adding Custom Fields to the Registration Page#1451
Update docs: Adding Custom Fields to the Registration Page#1451
Conversation
PR: openedx/frontend-app-authn#1595 Restore "Adding Custom Fields to Registration" How-To Guide Context This PR restores the documentation guide for adding custom fields to the registration page in the Authn MFE. This guide was previously removed from the repository, but there is no clear trace of when or why it was deleted from the codebase. The original file is: https://github.com/openedx/frontend-app-authn/blob/63d16364fc2aa6538dd876bd3f6fd5612a20d605/docs/how_tos/adding_custom_fields_to_the_registration.rst#b-add-fields-that-do-not-exist-in-the-user-profile-model Problem The documentation for extending registration fields is currently missing from the repository, making it difficult for operators to: Understand how to add custom fields to the registration page Configure REGISTRATION_EXTRA_FIELDS properly Extend the UserProfile model with custom fields Integrate custom forms with the Authn MFE This documentation is essential for organizations that need to collect additional user information during registration beyond the standard fields (email, username, password, name). Documentation Location The restored documentation is located at: docs/how_tos/adding_custom_fields_to_the_registration.rst Key Topics Covered Introduction to custom registration fields Difference between required and optional fields Step-by-step configuration for existing fields Advanced guide for custom UserProfile field extensions Backend and frontend integration requirements Configuration examples for different deployment methods Testing I followed up the instructions and everything is working as expected
| Add Custom Fields to the Registration Page | ||
| ********************************************* | ||
| ********************************** | ||
| Two Main Ways to Add Custom Fields |
There was a problem hiding this comment.
@efortish I'm confused by this document's structure. Theres' this heading "Two Main Ways to Add Custom Fields" but after these, there are two MORE headings, "Configuring Custom Registration Fields on the Back-End" and "Configuring Dynamic Registration Fields in Authn". How do they relate to each other?
| the registration form, and optional fields will appear on the progressive | ||
| profiling form. | ||
|
|
||
| Redefine Settings Above by Using the Tutor Plugin |
There was a problem hiding this comment.
@efortish why is using site configurations recommended over a Tutor plugin?
| additional actions that you need to perform: | ||
|
|
||
| #. Extend user profile model with new fields. An external plugin should be used for | ||
| this. **New fields must be migrated to the database.** |
There was a problem hiding this comment.
@efortish how is this migration performed, it's not described.
| #. Create a form with additional user profile fields and pass the path to this | ||
| form into ``settings``. The form can also be created in the Open edX plugin. | ||
| `Edx-cookiecutters <https://github.com/openedx/edx-cookiecutters>`_ can be | ||
| used for the plugin creation. |
There was a problem hiding this comment.
@efortish should this be the first step in this section? The first step says "Extend user profile model with new fields" but this step seems to actually describe creating a plugin. It's a bit confusing, if you could please elaborate.
|
|
||
| #. Install your custom form app and configure it in LMS. Follow the steps | ||
| outlined in the official Open edX documentation to configure custom | ||
| registration fields for your instance: `Customize the Registration Page <https://edx.readthedocs.io/projects/edx-installing-configuring-and-running/en/latest/configuration/customize_registration_page.html>`_. |
There was a problem hiding this comment.
@efortish this link is broken, but appears to just be a link to this page. As-written this sentence doesn't make a ton of sense.
| the ``ENABLE_DYNAMIC_REGISTRATION_FIELDS`` setting in the settings file. This | ||
| setting should be added to the plugin where the extension form is placed. | ||
|
|
||
| .. note:: See the context view for the Logistration page: `user_authn API Context View <https://github.com/openedx/edx-platform/blob/master/openedx/core/djangoapps/user_authn/api/views.py#L61>`_. |
There was a problem hiding this comment.
@efortish this link is broken I think because it's just a link to a line in the middle of a docstring. What should it link to?
| .. note:: See the context view for the Logistration page: `user_authn API Context View <https://github.com/openedx/edx-platform/blob/master/openedx/core/djangoapps/user_authn/api/views.py#L61>`_. | ||
|
|
||
| #. Add fields to the extended profile fields list. Add your `custom field | ||
| <https://edx.readthedocs.io/projects/edx-installing-configuring-and-running/en/latest/configuration/retrieve_extended_profile_metadata.html>`_ |
There was a problem hiding this comment.
@efortish this link is broken, but appears to just be a link to this page. As-written this sentence doesn't make a ton of sense.
| to the ``extended_profile_fields`` list to ensure it is checked correctly | ||
| during registration. | ||
|
|
||
| .. warning:: If this step is missed, fields from the extension form will not be saved. For more information, please see the condition in: `helper.py <https://github.com/openedx/edx-platform/blob/master/openedx/core/djangoapps/user_authn/api/helper.py#L97>`_. |
There was a problem hiding this comment.
@efortish can you double check this links to the right line of code? https://github.com/openedx/edx-platform/blob/master/openedx/core/djangoapps/user_authn/api/helper.py#L97
musaabhasan
left a comment
There was a problem hiding this comment.
This restores an important operator guide for custom registration fields. I left one correctness note on the setting name because this is the kind of copy-paste detail that can make the documented configuration appear to apply while the Authn MFE still does not receive dynamic fields.
|
|
||
| .. code-block:: python | ||
|
|
||
| ENABLE_DYNAMIC_REGISTRATION_FIELD = True, |
There was a problem hiding this comment.
This should be ENABLE_DYNAMIC_REGISTRATION_FIELDS with the plural FIELDS, and the same correction is needed in the second code block below. The singular setting name would be a no-op for operators following the guide, so they could complete the steps and still not enable dynamic registration fields. While touching this block, it would also be worth fixing required/optionl/hidden to required/optional/hidden.
Continuing the PR begun in #1429
PR: openedx/frontend-app-authn#1595 Restore "Adding Custom Fields to Registration" How-To Guide Context
This PR restores the documentation guide for adding custom fields to the registration page in the Authn MFE. This guide was previously removed from the repository, but there is no clear trace of when or why it was deleted from the codebase.
The original file is: https://github.com/openedx/frontend-app-authn/blob/63d16364fc2aa6538dd876bd3f6fd5612a20d605/docs/how_tos/adding_custom_fields_to_the_registration.rst#b-add-fields-that-do-not-exist-in-the-user-profile-model
Problem
The documentation for extending registration fields is currently missing from the repository, making it difficult for operators to:
Understand how to add custom fields to the registration page Configure REGISTRATION_EXTRA_FIELDS properly
Extend the UserProfile model with custom fields
Integrate custom forms with the Authn MFE
This documentation is essential for organizations that need to collect additional user information during registration beyond the standard fields (email, username, password, name).
Documentation Location
The restored documentation is located at:
docs/how_tos/adding_custom_fields_to_the_registration.rst
Key Topics Covered
Introduction to custom registration fields
Difference between required and optional fields
Step-by-step configuration for existing fields
Advanced guide for custom UserProfile field extensions Backend and frontend integration requirements
Configuration examples for different deployment methods Testing
I followed up the instructions and everything is working as expected