Repository navigation
Conversation
Combine dynamic profile metadata with model-backed static fields when serializing user account data. Static fields take precedence when keys overlap.
Author
|
Related with |
Implemented the account API split: extended_profile_fields is now the allowlist for extension fields. Unconfigured fields are ignored. Configured fields that exist as concrete fields on the PROFILE_EXTENSION_FORM model are read and written through that model. Other configured fields use UserProfile.meta. The extension form receives only submitted static fields, and its validation is limited to configured model-backed fields. Updated the account API tests for the new storage behavior.
johanseto
force-pushed
the
jlc/compatible-static-dynamic-extension-fields
branch
from
September 29, 2026 23:02
2542f67 to
92c2193
Compare
Author
|
Screencast.from.30-09-26.09.48.29.webm |
This branch has not been deployed
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
Summary
Route extended profile fields to the correct storage in the account API instead of indiscriminately combining model-backed fields with
UserProfile.meta.extended_profile_fieldsacts as the allowlist for account API profile extensions. For each configured field, the API checks whether its name is a concrete field on the model configured byPROFILE_EXTENSION_FORM:UserProfile.meta.extended_profile_fieldsare ignored by the account API and are not included in extended-profile validation.Reads use the same field classification: model-backed fields come from the extension model, and dynamic fields come from
UserProfile.meta. If the user does not yet have an extension-model record, configured static fields can still be read frommetaas a compatibility fallback. When a model record exists, its values are authoritative for model-backed fields.Test
#Example Configuration
Settings:
Tenant config settings:
Check the get of the data in the following endpoint.
Validate the static data - > extension profile form model
and dynamic data -> meta from profile data is retrieved.
http://local.openedx.io:8000/api/user/v1/accounts/admin
Before
After