Skip to content

Commit 40dfec5

Browse files
authored
refactor: BOMS-200 contract features dict settings into top level settings (#179)
Ticket: https://2u-internal.atlassian.net/browse/BOMS-200
1 parent 485d883 commit 40dfec5

File tree

4 files changed

+103
-108
lines changed

4 files changed

+103
-108
lines changed

configuration_files/cms.yml

Lines changed: 28 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -296,35 +296,34 @@ EXTRA_MIDDLEWARE_CLASSES: []
296296
FACEBOOK_API_VERSION: v2.1
297297
FACEBOOK_APP_ID: FACEBOOK_APP_ID
298298
FACEBOOK_APP_SECRET: FACEBOOK_APP_SECRET
299-
FEATURES:
300-
AUTH_USE_OPENID_PROVIDER: true
301-
AUTOMATIC_AUTH_FOR_TESTING: false
302-
CUSTOM_COURSES_EDX: false
303-
ENABLE_BULK_ENROLLMENT_VIEW: false
304-
ENABLE_COMBINED_LOGIN_REGISTRATION: true
305-
ENABLE_CORS_HEADERS: false
306-
ENABLE_COUNTRY_ACCESS: false
307-
ENABLE_CREDIT_API: false
308-
ENABLE_CREDIT_ELIGIBILITY: false
309-
ENABLE_CROSS_DOMAIN_CSRF_COOKIE: false
310-
ENABLE_CSMH_EXTENDED: true
311-
ENABLE_DISCUSSION_HOME_PANEL: true
312-
ENABLE_DISCUSSION_SERVICE: true
313-
ENABLE_EDXNOTES: true
314-
ENABLE_ENROLLMENT_RESET: false
315-
ENABLE_EXPORT_GIT: false
316-
ENABLE_GRADE_DOWNLOADS: true
317-
ENABLE_LTI_PROVIDER: false
318-
ENABLE_MOBILE_REST_API: false
319-
ENABLE_OAUTH2_PROVIDER: false
320-
ENABLE_PUBLISHER: false
321-
ENABLE_READING_FROM_MULTIPLE_HISTORY_TABLES: true
322-
ENABLE_SPECIAL_EXAMS: false
323-
ENABLE_SYSADMIN_DASHBOARD: false
324-
ENABLE_THIRD_PARTY_AUTH: true
325-
ENABLE_VIDEO_UPLOAD_PIPELINE: false
326-
SHOW_FOOTER_LANGUAGE_SELECTOR: false
327-
SHOW_HEADER_LANGUAGE_SELECTOR: false
299+
AUTH_USE_OPENID_PROVIDER: true
300+
AUTOMATIC_AUTH_FOR_TESTING: false
301+
CUSTOM_COURSES_EDX: false
302+
ENABLE_BULK_ENROLLMENT_VIEW: false
303+
ENABLE_COMBINED_LOGIN_REGISTRATION: true
304+
ENABLE_CORS_HEADERS: false
305+
ENABLE_COUNTRY_ACCESS: false
306+
ENABLE_CREDIT_API: false
307+
ENABLE_CREDIT_ELIGIBILITY: false
308+
ENABLE_CROSS_DOMAIN_CSRF_COOKIE: false
309+
ENABLE_CSMH_EXTENDED: true
310+
ENABLE_DISCUSSION_HOME_PANEL: true
311+
ENABLE_DISCUSSION_SERVICE: true
312+
ENABLE_EDXNOTES: true
313+
ENABLE_ENROLLMENT_RESET: false
314+
ENABLE_EXPORT_GIT: false
315+
ENABLE_GRADE_DOWNLOADS: true
316+
ENABLE_LTI_PROVIDER: false
317+
ENABLE_MOBILE_REST_API: false
318+
ENABLE_OAUTH2_PROVIDER: false
319+
ENABLE_PUBLISHER: false
320+
ENABLE_READING_FROM_MULTIPLE_HISTORY_TABLES: true
321+
ENABLE_SPECIAL_EXAMS: false
322+
ENABLE_SYSADMIN_DASHBOARD: false
323+
ENABLE_THIRD_PARTY_AUTH: true
324+
ENABLE_VIDEO_UPLOAD_PIPELINE: false
325+
SHOW_FOOTER_LANGUAGE_SELECTOR: false
326+
SHOW_HEADER_LANGUAGE_SELECTOR: false
328327
FEEDBACK_SUBMISSION_EMAIL: ''
329328
FERNET_KEYS:
330329
- DUMMY KEY CHANGE BEFORE GOING TO PRODUCTION

configuration_files/lms.yml

Lines changed: 28 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -327,35 +327,34 @@ EXTRA_MIDDLEWARE_CLASSES: []
327327
FACEBOOK_API_VERSION: v2.1
328328
FACEBOOK_APP_ID: FACEBOOK_APP_ID
329329
FACEBOOK_APP_SECRET: FACEBOOK_APP_SECRET
330-
FEATURES:
331-
AUTH_USE_OPENID_PROVIDER: true
332-
AUTOMATIC_AUTH_FOR_TESTING: false
333-
CUSTOM_COURSES_EDX: false
334-
ENABLE_BULK_ENROLLMENT_VIEW: false
335-
ENABLE_COMBINED_LOGIN_REGISTRATION: true
336-
ENABLE_CORS_HEADERS: false
337-
ENABLE_COUNTRY_ACCESS: false
338-
ENABLE_CREDIT_API: false
339-
ENABLE_CREDIT_ELIGIBILITY: false
340-
ENABLE_CROSS_DOMAIN_CSRF_COOKIE: false
341-
ENABLE_CSMH_EXTENDED: true
342-
ENABLE_DISCUSSION_HOME_PANEL: true
343-
ENABLE_DISCUSSION_SERVICE: true
344-
ENABLE_EDXNOTES: true
345-
ENABLE_ENROLLMENT_RESET: false
346-
ENABLE_EXPORT_GIT: false
347-
ENABLE_GRADE_DOWNLOADS: true
348-
ENABLE_LTI_PROVIDER: false
349-
ENABLE_MOBILE_REST_API: false
350-
ENABLE_OAUTH2_PROVIDER: false
351-
ENABLE_PUBLISHER: false
352-
ENABLE_READING_FROM_MULTIPLE_HISTORY_TABLES: true
353-
ENABLE_SPECIAL_EXAMS: false
354-
ENABLE_SYSADMIN_DASHBOARD: false
355-
ENABLE_THIRD_PARTY_AUTH: true
356-
ENABLE_VIDEO_UPLOAD_PIPELINE: false
357-
SHOW_FOOTER_LANGUAGE_SELECTOR: false
358-
SHOW_HEADER_LANGUAGE_SELECTOR: false
330+
AUTH_USE_OPENID_PROVIDER: true
331+
AUTOMATIC_AUTH_FOR_TESTING: false
332+
CUSTOM_COURSES_EDX: false
333+
ENABLE_BULK_ENROLLMENT_VIEW: false
334+
ENABLE_COMBINED_LOGIN_REGISTRATION: true
335+
ENABLE_CORS_HEADERS: false
336+
ENABLE_COUNTRY_ACCESS: false
337+
ENABLE_CREDIT_API: false
338+
ENABLE_CREDIT_ELIGIBILITY: false
339+
ENABLE_CROSS_DOMAIN_CSRF_COOKIE: false
340+
ENABLE_CSMH_EXTENDED: true
341+
ENABLE_DISCUSSION_HOME_PANEL: true
342+
ENABLE_DISCUSSION_SERVICE: true
343+
ENABLE_EDXNOTES: true
344+
ENABLE_ENROLLMENT_RESET: false
345+
ENABLE_EXPORT_GIT: false
346+
ENABLE_GRADE_DOWNLOADS: true
347+
ENABLE_LTI_PROVIDER: false
348+
ENABLE_MOBILE_REST_API: false
349+
ENABLE_OAUTH2_PROVIDER: false
350+
ENABLE_PUBLISHER: false
351+
ENABLE_READING_FROM_MULTIPLE_HISTORY_TABLES: true
352+
ENABLE_SPECIAL_EXAMS: false
353+
ENABLE_SYSADMIN_DASHBOARD: false
354+
ENABLE_THIRD_PARTY_AUTH: true
355+
ENABLE_VIDEO_UPLOAD_PIPELINE: false
356+
SHOW_FOOTER_LANGUAGE_SELECTOR: false
357+
SHOW_HEADER_LANGUAGE_SELECTOR: false
359358
FEEDBACK_SUBMISSION_EMAIL: ''
360359
FERNET_KEYS:
361360
- DUMMY KEY CHANGE BEFORE GOING TO PRODUCTION

py_configuration_files/cms.py

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -51,13 +51,13 @@
5151

5252
LMS_BASE = 'localhost:18000'
5353
LMS_ROOT_URL = f'http://{LMS_BASE}'
54-
FEATURES['PREVIEW_LMS_BASE'] = "preview." + LMS_BASE
54+
PREVIEW_LMS_BASE = "preview." + LMS_BASE
5555

5656
FRONTEND_REGISTER_URL = LMS_ROOT_URL + '/register'
5757

5858
################################## Video Pipeline Settings #########################
5959

60-
FEATURES['ENABLE_VIDEO_UPLOAD_PIPELINE'] = True
60+
ENABLE_VIDEO_UPLOAD_PIPELINE = True
6161

6262
########################### PIPELINE #################################
6363

@@ -132,7 +132,7 @@ def should_show_debug_toolbar(request): # lint-amnesty, pylint: disable=missing
132132

133133

134134
################################ MILESTONES ################################
135-
FEATURES['MILESTONES_APP'] = True
135+
MILESTONES_APP = True
136136

137137
########################### ORGANIZATIONS #################################
138138
# Although production studio.edx.org disables `ORGANIZATIONS_AUTOCREATE`,
@@ -142,16 +142,16 @@ def should_show_debug_toolbar(request): # lint-amnesty, pylint: disable=missing
142142
ORGANIZATIONS_AUTOCREATE = True
143143

144144
################################ ENTRANCE EXAMS ################################
145-
FEATURES['ENTRANCE_EXAMS'] = True
145+
ENTRANCE_EXAMS = True
146146

147147
################################ COURSE LICENSES ################################
148-
FEATURES['LICENSING'] = True
148+
LICENSING = True
149149
# Needed to enable licensing on video blocks
150150
XBLOCK_SETTINGS.update({'VideoBlock': {'licensing_enabled': True}})
151151

152152
################################ SEARCH INDEX ################################
153-
FEATURES['ENABLE_COURSEWARE_INDEX'] = True
154-
FEATURES['ENABLE_LIBRARY_INDEX'] = False
153+
ENABLE_COURSEWARE_INDEX = True
154+
ENABLE_LIBRARY_INDEX = False
155155
SEARCH_ENGINE = "search.elastic.ElasticSearchEngine"
156156

157157
ELASTIC_SEARCH_CONFIG = [
@@ -163,22 +163,22 @@ def should_show_debug_toolbar(request): # lint-amnesty, pylint: disable=missing
163163
]
164164

165165
################################ COURSE DISCUSSIONS ###########################
166-
FEATURES['ENABLE_DISCUSSION_SERVICE'] = True
166+
ENABLE_DISCUSSION_SERVICE = True
167167

168168
################################ CREDENTIALS ###########################
169169
CREDENTIALS_SERVICE_USERNAME = 'credentials_worker'
170170

171171
########################## Certificates Web/HTML View #######################
172-
FEATURES['CERTIFICATES_HTML_VIEW'] = True
172+
CERTIFICATES_HTML_VIEW = True
173173

174174
########################## AUTHOR PERMISSION #######################
175-
FEATURES['ENABLE_CREATOR_GROUP'] = True
175+
ENABLE_CREATOR_GROUP = True
176176

177177
########################## Library creation organizations restriction #######################
178-
FEATURES['ENABLE_ORGANIZATION_STAFF_ACCESS_FOR_CONTENT_LIBRARIES'] = True
178+
ENABLE_ORGANIZATION_STAFF_ACCESS_FOR_CONTENT_LIBRARIES = True
179179

180180
################### FRONTEND APPLICATION PUBLISHER URL ###################
181-
FEATURES['FRONTEND_APP_PUBLISHER_URL'] = 'http://localhost:18400'
181+
FRONTEND_APP_PUBLISHER_URL = 'http://localhost:18400'
182182

183183
################### FRONTEND APPLICATION COURSE AUTHORING ###################
184184
COURSE_AUTHORING_MICROFRONTEND_URL = 'http://localhost:2001'
@@ -252,13 +252,13 @@ def should_show_debug_toolbar(request): # lint-amnesty, pylint: disable=missing
252252
SECRET_KEY = '85920908f28904ed733fe576320db18cabd7b6cd'
253253

254254
############# CORS headers for cross-domain requests #################
255-
FEATURES['ENABLE_CORS_HEADERS'] = True
255+
ENABLE_CORS_HEADERS = True
256256
CORS_ALLOW_CREDENTIALS = True
257257
CORS_ORIGIN_ALLOW_ALL = True
258258

259259
################### Special Exams (Proctoring) and Prereqs ###################
260-
FEATURES['ENABLE_SPECIAL_EXAMS'] = True
261-
FEATURES['ENABLE_PREREQUISITE_COURSES'] = True
260+
ENABLE_SPECIAL_EXAMS = True
261+
ENABLE_PREREQUISITE_COURSES = True
262262

263263
# Used in edx-proctoring for ID generation in lieu of SECRET_KEY - dummy value
264264
# (ref MST-637)

py_configuration_files/lms.py

Lines changed: 32 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -145,32 +145,31 @@ def should_show_debug_toolbar(request): # lint-amnesty, pylint: disable=missing
145145
WEBPACK_CONFIG_PATH = 'webpack.dev.config.js'
146146

147147
########################### VERIFIED CERTIFICATES #################################
148-
149-
FEATURES['AUTOMATIC_VERIFY_STUDENT_IDENTITY_FOR_TESTING'] = True
148+
AUTOMATIC_VERIFY_STUDENT_IDENTITY_FOR_TESTING = True
150149

151150
########################### External REST APIs #################################
152-
FEATURES['ENABLE_OAUTH2_PROVIDER'] = True
153-
FEATURES['ENABLE_MOBILE_REST_API'] = True
154-
FEATURES['ENABLE_VIDEO_ABSTRACTION_LAYER_API'] = True
151+
ENABLE_OAUTH2_PROVIDER = True
152+
ENABLE_MOBILE_REST_API = True
153+
ENABLE_VIDEO_ABSTRACTION_LAYER_API = True
155154

156155
########################## SECURITY #######################
157-
FEATURES['ENABLE_MAX_FAILED_LOGIN_ATTEMPTS'] = False
158-
FEATURES['SQUELCH_PII_IN_LOGS'] = False
159-
FEATURES['PREVENT_CONCURRENT_LOGINS'] = False
156+
ENABLE_MAX_FAILED_LOGIN_ATTEMPTS = False
157+
SQUELCH_PII_IN_LOGS = False
158+
PREVENT_CONCURRENT_LOGINS = False
160159

161160
########################### Milestones #################################
162-
FEATURES['MILESTONES_APP'] = True
161+
MILESTONES_APP = True
163162

164163
########################### Entrance Exams #################################
165-
FEATURES['ENTRANCE_EXAMS'] = True
164+
ENTRANCE_EXAMS = True
166165

167166
################################ COURSE LICENSES ################################
168-
FEATURES['LICENSING'] = True
167+
LICENSING = True
169168

170169

171170
########################## Courseware Search #######################
172-
FEATURES['ENABLE_COURSEWARE_SEARCH'] = True
173-
FEATURES['ENABLE_COURSEWARE_SEARCH_FOR_COURSE_STAFF'] = True
171+
ENABLE_COURSEWARE_SEARCH = True
172+
ENABLE_COURSEWARE_SEARCH_FOR_COURSE_STAFF = True
174173
SEARCH_ENGINE = 'search.elastic.ElasticSearchEngine'
175174
SEARCH_COURSEWARE_CONTENT_LOG_PARAMS = True
176175

@@ -183,11 +182,11 @@ def should_show_debug_toolbar(request): # lint-amnesty, pylint: disable=missing
183182
]
184183

185184
########################## Dashboard Search #######################
186-
FEATURES['ENABLE_DASHBOARD_SEARCH'] = False
185+
ENABLE_DASHBOARD_SEARCH = False
187186

188187

189188
########################## Certificates Web/HTML View #######################
190-
FEATURES['CERTIFICATES_HTML_VIEW'] = True
189+
CERTIFICATES_HTML_VIEW = True
191190

192191

193192
########################## Course Discovery #######################
@@ -209,14 +208,14 @@ def should_show_debug_toolbar(request): # lint-amnesty, pylint: disable=missing
209208
'language': LANGUAGE_MAP,
210209
}
211210

212-
FEATURES['ENABLE_COURSE_DISCOVERY'] = False
211+
ENABLE_COURSE_DISCOVERY = False
213212
# Setting for overriding default filtering facets for Course discovery
214213
# COURSE_DISCOVERY_FILTERS = ["org", "language", "modes"]
215-
FEATURES['COURSES_ARE_BROWSEABLE'] = True
214+
COURSES_ARE_BROWSEABLE = True
216215
HOMEPAGE_COURSE_MAX = 9
217216

218217
# Software secure fake page feature flag
219-
FEATURES['ENABLE_SOFTWARE_SECURE_FAKE'] = True
218+
ENABLE_SOFTWARE_SECURE_FAKE = True
220219

221220
# Setting for the testing of Software Secure Result Callback
222221
VERIFY_STUDENT["SOFTWARE_SECURE"] = {
@@ -230,14 +229,14 @@ def should_show_debug_toolbar(request): # lint-amnesty, pylint: disable=missing
230229

231230

232231
########################## Shopping cart ##########################
233-
FEATURES['ENABLE_COSMETIC_DISPLAY_PRICE'] = True
232+
ENABLE_COSMETIC_DISPLAY_PRICE = True
234233

235234
######################### Program Enrollments #####################
236-
FEATURES['ENABLE_ENROLLMENT_RESET'] = True
235+
ENABLE_ENROLLMENT_RESET = True
237236

238237
########################## Third Party Auth #######################
239238

240-
if FEATURES.get('ENABLE_THIRD_PARTY_AUTH') and (
239+
if ENABLE_THIRD_PARTY_AUTH and (
241240
'common.djangoapps.third_party_auth.dummy.DummyBackend' not in AUTHENTICATION_BACKENDS
242241
):
243242
AUTHENTICATION_BACKENDS = ['common.djangoapps.third_party_auth.dummy.DummyBackend'] + list(AUTHENTICATION_BACKENDS)
@@ -300,7 +299,7 @@ def should_show_debug_toolbar(request): # lint-amnesty, pylint: disable=missing
300299
LEARNER_HOME_MICROFRONTEND_URL = 'http://localhost:1996'
301300

302301
###################### Cross-domain requests ######################
303-
FEATURES['ENABLE_CORS_HEADERS'] = True
302+
ENABLE_CORS_HEADERS = True
304303
CORS_ALLOW_CREDENTIALS = True
305304
CORS_ORIGIN_WHITELIST = ()
306305
CORS_ORIGIN_ALLOW_ALL = True
@@ -412,17 +411,15 @@ def should_show_debug_toolbar(request): # lint-amnesty, pylint: disable=missing
412411

413412
############## Docker based devstack settings #######################
414413

415-
FEATURES.update({
416-
'AUTOMATIC_AUTH_FOR_TESTING': True,
417-
'ENABLE_DISCUSSION_SERVICE': True,
418-
'SHOW_HEADER_LANGUAGE_SELECTOR': True,
414+
AUTOMATIC_AUTH_FOR_TESTING = True
415+
ENABLE_DISCUSSION_SERVICE = True
416+
SHOW_HEADER_LANGUAGE_SELECTOR = True
419417

420-
# Enable enterprise integration by default.
421-
# See https://github.com/openedx/edx-enterprise/blob/master/docs/development.rst for
422-
# more background on edx-enterprise.
423-
# Toggle this off if you don't want anything to do with enterprise in devstack.
424-
'ENABLE_ENTERPRISE_INTEGRATION': True,
425-
})
418+
# Enable enterprise integration by default.
419+
# See https://github.com/openedx/edx-enterprise/blob/master/docs/development.rst for
420+
# more background on edx-enterprise.
421+
# Toggle this off if you don't want anything to do with enterprise in devstack.
422+
ENABLE_ENTERPRISE_INTEGRATION = True
426423

427424
ENABLE_MKTG_SITE = os.environ.get('ENABLE_MARKETING_SITE', True)
428425
MARKETING_SITE_ROOT = os.environ.get('MARKETING_SITE_ROOT', 'http://localhost:8080')
@@ -468,7 +465,7 @@ def should_show_debug_toolbar(request): # lint-amnesty, pylint: disable=missing
468465
'system_wide_roles.SystemWideRoleAssignment',
469466
)
470467

471-
if FEATURES.get('ENABLE_ENTERPRISE_INTEGRATION'):
468+
if ENABLE_ENTERPRISE_INTEGRATION:
472469
SYSTEM_WIDE_ROLE_CLASSES.append(
473470
'enterprise.SystemWideEnterpriseUserRoleAssignment',
474471
)
@@ -504,8 +501,8 @@ def should_show_debug_toolbar(request): # lint-amnesty, pylint: disable=missing
504501
# LOGGING['loggers']['django.db.backends'] = {'handlers': ['console'], 'level': 'DEBUG', 'propagate': False}
505502

506503
################### Special Exams (Proctoring) and Prereqs ###################
507-
FEATURES['ENABLE_SPECIAL_EXAMS'] = True
508-
FEATURES['ENABLE_PREREQUISITE_COURSES'] = True
504+
ENABLE_SPECIAL_EXAMS = True
505+
ENABLE_PREREQUISITE_COURSES = True
509506

510507
# Used in edx-proctoring for ID generation in lieu of SECRET_KEY - dummy value
511508
# (ref MST-637)

0 commit comments

Comments
 (0)