refactor: migrate 10 more flags off FEATURES-as-dict (batch 9)#38906
Draft
feanil wants to merge 10 commits into
Draft
refactor: migrate 10 more flags off FEATURES-as-dict (batch 9)#38906feanil wants to merge 10 commits into
feanil wants to merge 10 commits into
Conversation
The flag was only ever read via settings.FEATURES.get with an inline default and was never defined in any envs file. Add an annotated flat DjangoSetting definition (default False, matching the old inline default) to cms/envs/common.py so the CMS-only reader can use settings.X directly.
The flag had no envs definition and was only read via settings.FEATURES.get (with lms/envs/test.py already setting the flat value, routed through the FeaturesProxy bridge). Add an annotated flat DjangoSetting definition (default False) to lms/envs/common.py and migrate the two LMS-only readers. In course_tools.py this also drops the now-unnecessary 'FEATURES is None' (Edge) guard, since the flat setting always resolves to its default.
The two test classes are plain unittest.TestCase, so @override_settings can't decorate them; patch.object the flat setting directly instead, mirroring the prior patch.object(settings, 'FEATURES', ...) approach.
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
Migrates 10 more feature flags off
settings.FEATURES['X']dict-style access onto flat settings (settings.X) with@override_settings(X=Y)in tests. Follows the pattern established in #38772.Each commit migrates a single flag:
Two flags (ENABLE_EXTENDED_COURSE_DETAILS, ENABLE_FINANCIAL_ASSISTANCE_FORM) had no flat definition in any
envs/common.py, so those commits add an annotatedDjangoSettingdefinition matching the prior inline default before switching the readers.