fix: centralize authn MFE branding and remove duplicate context#226
Open
subhashree-sahu31 wants to merge 2 commits intorelease-ulmofrom
Open
Conversation
There was a problem hiding this comment.
Pull request overview
This PR refactors how enterprise branding is assembled for the Authn MFE context by centralizing the branding payload construction in enterprise_support.utils, and removing a duplicate/obsolete get_mfe_context implementation from that module.
Changes:
- Added
build_enterprise_branding_for_authn_mfehelper to build theenterpriseBrandingpayload from existing sidebar context. - Updated
openedx.core.djangoapps.user_authn.views.utils.get_mfe_contextto use the new helper. - Removed the duplicate
get_mfe_contextimplementation fromopenedx.features.enterprise_support.utils.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| openedx/features/enterprise_support/utils.py | Removes duplicate MFE context builder; introduces centralized enterprise branding payload helper. |
| openedx/core/djangoapps/user_authn/views/utils.py | Uses the new centralized branding helper when assembling Authn MFE context. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
ssurendrannair
approved these changes
Apr 10, 2026
nakhan-sonata-afk
approved these changes
Apr 10, 2026
nakhan-sonata-afk
left a comment
There was a problem hiding this comment.
I have reviewed it, fix looks good. Circular import is fixed by moving the import inside the function.
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.
PR Description
This PR fixes the circular import risk affecting enterprise SSO/Authn MFE context generation by removing duplicate MFE context logic and centralizing enterprise branding assembly.
Problem
The enterprise and authn utility modules had overlapping responsibility for building Authn MFE context. That duplication created a fragile import relationship between:
In some load paths, that increased the risk of circular imports and partial module initialization, which could affect enterprise SSO/org-name resolution.
Fix
get_mfe_contextimplementation from utils.pyget_mfe_contextin utils.pyenterpriseBrandingpayloadget_mfe_contextto call that helper via a function-scoped importWhy This Is Safe
enterpriseSlugis still included inenterpriseBrandingValidation
Verified that:
get_mfe_contextremains in the codebase##Testing
JIRA
https://2u-internal.atlassian.net/browse/AUT-112