refactor: migrate DISABLE_START_DATES off FEATURES-as-dict#38912
Draft
feanil wants to merge 1 commit into
Draft
Conversation
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.
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 the
DISABLE_START_DATESfeature flag offsettings.FEATURES['DISABLE_START_DATES']dict-style access onto the flat settingsettings.DISABLE_START_DATES, with@override_settings(DISABLE_START_DATES=...)in tests. Follows the pattern established in #38772.DISABLE_START_DATESgets its own PR (rather than a batch) because of its heavy test usage.What changed
lms/djangoapps/courseware/access_utils.pynow readssettings.DISABLE_START_DATES. The flag is already defined inopenedx/envs/common.py(defaultFalse;lms/envs/test.pysetsTrue), so bare access resolves in every process.patch.dict(settings.FEATURES, {'DISABLE_START_DATES': ...})(and theoverride_settings(FEATURES=...)/patch.multiplevariants) to@override_settings(DISABLE_START_DATES=...).Notes
FEATURESdict also set a flag that is not yet migrated (ENABLE_MKTG_SITE,ENABLE_ENTERPRISE_INTEGRATION,ENABLE_PREREQUISITE_COURSES), onlyDISABLE_START_DATESis pulled out to@override_settings; the other flag stays on thepatch.dictfor its own migration.brandingmodule-levelFEATURES_*_STARTDATEdict copies and the student-dashboardMOCK_SETTINGSpatch.multipledict hadDISABLE_START_DATESflattened out to the top level / a flat override.