feat: implement a new initialization pipeline step and runtime patchi…#299
Merged
andrey-canon merged 2 commits intomasterfrom Nov 13, 2025
Merged
feat: implement a new initialization pipeline step and runtime patchi…#299andrey-canon merged 2 commits intomasterfrom
andrey-canon merged 2 commits intomasterfrom
Conversation
…m_fields user_authn api module
ce543ff to
c36821b
Compare
johanseto
reviewed
Nov 4, 2025
Collaborator
johanseto
left a comment
There was a problem hiding this comment.
Working in my local env
Screencast.from.04-11-25.14.54.46.webm
Only some comments.
| Updates the default Open edX gender field options to include only "Male" and "Female" | ||
| for compatibility with specific business rules. | ||
|
|
||
| set_mako_templates: |
Collaborator
There was a problem hiding this comment.
Nice update of docstrings =)
eox_nelp/user_authn/api/patches.py
Outdated
| if field_name in extended_profile_fields: | ||
| return _generate_handler(field_name) | ||
|
|
||
| raise AttributeError() |
Collaborator
There was a problem hiding this comment.
This exception could send some data or something more informative.
Comment on lines
+65
to
+75
| mock_get_request.return_value = self.mock_request | ||
|
|
||
| configuration_helpers.get_value.side_effect = lambda key, default=None: { | ||
| "extended_profile_fields": ["sport"], | ||
| "extended_profile_fields_translations": { | ||
| "es": {field_name: translated_label}, | ||
| }, | ||
| }.get(key, default) | ||
|
|
||
| handler = patches.form_field_getattr_patch(attribute) | ||
| handler(is_field_required=False) |
Collaborator
There was a problem hiding this comment.
Suggested change
| mock_get_request.return_value = self.mock_request | |
| configuration_helpers.get_value.side_effect = lambda key, default=None: { | |
| "extended_profile_fields": ["sport"], | |
| "extended_profile_fields_translations": { | |
| "es": {field_name: translated_label}, | |
| }, | |
| }.get(key, default) | |
| handler = patches.form_field_getattr_patch(attribute) | |
| handler(is_field_required=False) | |
| mock_get_request.return_value = self.mock_request | |
| configuration_helpers.get_value.side_effect = lambda key, default=None: { | |
| "extended_profile_fields": ["sport"], | |
| "extended_profile_fields_translations": { | |
| "es": {field_name: translated_label}, | |
| }, | |
| }.get(key, default) | |
| handler = patches.form_field_getattr_patch(attribute) | |
| handler(is_field_required=False) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
This pull request introduces a new runtime patch for the openedx.core.djangoapps.user_authn.api.form_fields module.
The patch enables dynamic generation of registration field handlers (add__field) based on extende_profile_fields values, allowing tenants to define and translate fields without modifying the LMS codebase.
Issue # 1447
Testing instructions
http://local.openedx.io:8000/api/mfe_context?is_register_page=trueand validate theoptionalFieldskeyBefore
After