fix: move audio description toggle to safe shared module#303
Open
viv-helix wants to merge 1 commit into
Open
Conversation
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.
Summary
Move the audio description feature toggle into a lightweight shared module to avoid import-time side effects during LMS initialization.
Problem
audio_description_enabledwas being imported fromcms.djangoapps.contentstore.toggles.That module now imports
search_apiat module load time, which triggers early Django model initialization before apps/settings are fully ready. This caused LMS startup/runtime failures and exposed downstream initialization issues, including theExtendedCasbinRuleerror.The previous lazy import behavior was effectively masking these import-order dependencies.
Fix
Move:
ENABLE_AUDIO_DESCRIPTIONaudio_description_enabledfrom:
cms.djangoapps.contentstore.togglesto:
openedx.core.djangoapps.video_config.togglesUpdate LMS/CMS callers to import the toggle from the new shared module.
Result
The audio description toggle can now be safely imported from both LMS and CMS without pulling in
search_apior triggering premature Django model loading.