refactor: migrate 10 more flags off FEATURES-as-dict (batch 9)#38906
Open
feanil wants to merge 10 commits into
Open
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
feanil
force-pushed
the
feanil/features-dict-batch-9
branch
from
July 20, 2026 14:41
c8362b5 to
68603f9
Compare
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.
feanil
force-pushed
the
feanil/features-dict-batch-9
branch
from
July 20, 2026 15:23
68603f9 to
42168a7
Compare
feanil
commented
Jul 20, 2026
|
|
||
|
|
||
| @ddt.ddt | ||
| @patch.object(settings, 'FEATURES', create=True, new={ |
Contributor
Author
There was a problem hiding this comment.
We're not using override_settings here because these test classes don't use the django SimpleTestCase as the base test class which is needed for override_settings to work correctly as a class decorator.
I'm not sure if the fact that these are just unittest.TestCases is delibrate or not but that's out of scope of this migration which is just dropping the extra hop through the FEATURES dict.
feanil
marked this pull request as ready for review
July 20, 2026 15:36
feanil
requested review from
a team,
farhan,
irtazaakram and
salman2013
as code owners
July 20, 2026 15:36
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.