Skip to content

refactor: migrate DISABLE_START_DATES off FEATURES-as-dict#38912

Draft
feanil wants to merge 1 commit into
masterfrom
feanil/features-dict-disable-start-dates
Draft

refactor: migrate DISABLE_START_DATES off FEATURES-as-dict#38912
feanil wants to merge 1 commit into
masterfrom
feanil/features-dict-disable-start-dates

Conversation

@feanil

@feanil feanil commented Jul 20, 2026

Copy link
Copy Markdown
Contributor

Summary

Migrates the DISABLE_START_DATES feature flag off settings.FEATURES['DISABLE_START_DATES'] dict-style access onto the flat setting settings.DISABLE_START_DATES, with @override_settings(DISABLE_START_DATES=...) in tests. Follows the pattern established in #38772.

DISABLE_START_DATES gets its own PR (rather than a batch) because of its heavy test usage.

What changed

  • Production reader — the single reader in lms/djangoapps/courseware/access_utils.py now reads settings.DISABLE_START_DATES. The flag is already defined in openedx/envs/common.py (default False; lms/envs/test.py sets True), so bare access resolves in every process.
  • ~35 test overrides across the courseware, grades, mobile_api, discussion, course_blocks, course_groups, branding, and student test suites converted from patch.dict(settings.FEATURES, {'DISABLE_START_DATES': ...}) (and the override_settings(FEATURES=...) / patch.multiple variants) to @override_settings(DISABLE_START_DATES=...).

Notes

  • Where a test's FEATURES dict also set a flag that is not yet migrated (ENABLE_MKTG_SITE, ENABLE_ENTERPRISE_INTEGRATION, ENABLE_PREREQUISITE_COURSES), only DISABLE_START_DATES is pulled out to @override_settings; the other flag stays on the patch.dict for its own migration.
  • The branding module-level FEATURES_*_STARTDATE dict copies and the student-dashboard MOCK_SETTINGS patch.multiple dict had DISABLE_START_DATES flattened out to the top level / a flat override.

Switch the single production reader (courseware/access_utils.py) from
settings.FEATURES['DISABLE_START_DATES'] to the flat settings.DISABLE_START_DATES
(already defined in openedx/envs/common.py, so bare access works in every
process), and convert ~35 test overrides across the courseware, grades,
mobile_api, discussion, course_blocks, course_groups, branding and student
suites to @override_settings(DISABLE_START_DATES=...).

Where a test's FEATURES dict also set an as-yet-unmigrated flag
(ENABLE_MKTG_SITE, ENABLE_ENTERPRISE_INTEGRATION, ENABLE_PREREQUISITE_COURSES),
only DISABLE_START_DATES is pulled out to @override_settings and the other
flag stays on the patch.dict. Also flattens the DISABLE_START_DATES key out
of the branding FEATURES_*_STARTDATE copies and the student-dashboard
MOCK_SETTINGS patch.multiple dict.
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