Skip to content

refactor: migrate 10 more flags off FEATURES-as-dict (batch 9)#38906

Draft
feanil wants to merge 10 commits into
masterfrom
feanil/features-dict-batch-9
Draft

refactor: migrate 10 more flags off FEATURES-as-dict (batch 9)#38906
feanil wants to merge 10 commits into
masterfrom
feanil/features-dict-batch-9

Conversation

@feanil

@feanil feanil commented Jul 18, 2026

Copy link
Copy Markdown
Contributor

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:

  • EDITABLE_SHORT_DESCRIPTION
  • ENABLE_COSMETIC_DISPLAY_PRICE
  • ENABLE_EXTENDED_COURSE_DETAILS
  • ENABLE_FINANCIAL_ASSISTANCE_FORM
  • ENABLE_FOOTER_MOBILE_APP_LINKS
  • ENABLE_HIDE_FROM_TOC_UI
  • ENABLE_NEW_BULK_EMAIL_EXPERIENCE
  • ENABLE_PUBLISHER
  • ENABLE_SOFTWARE_SECURE_FAKE
  • FALLBACK_TO_ENGLISH_TRANSCRIPTS

Two flags (ENABLE_EXTENDED_COURSE_DETAILS, ENABLE_FINANCIAL_ASSISTANCE_FORM) had no flat definition in any envs/common.py, so those commits add an annotated DjangoSetting definition matching the prior inline default before switching the readers.

feanil added 10 commits July 17, 2026 21:37
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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant