-
Notifications
You must be signed in to change notification settings - Fork 4.3k
Expand file tree
/
Copy pathtoggles.py
More file actions
564 lines (457 loc) · 22.1 KB
/
toggles.py
File metadata and controls
564 lines (457 loc) · 22.1 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
"""
CMS feature toggles.
"""
from edx_toggles.toggles import SettingToggle, WaffleFlag
from openedx.core.djangoapps.content.search import api as search_api
from openedx.core.djangoapps.waffle_utils import CourseWaffleFlag
# .. toggle_name: ENABLE_EXPORT_GIT
# .. toggle_implementation: SettingToggle
# .. toggle_default: False
# .. toggle_description: When enabled, a "Export to Git" menu item is added to the course studio for courses that have a
# valid "giturl" attribute. Exporting a course to git causes the course to be exported in the directory indicated by
# the GIT_REPO_EXPORT_DIR setting. Note that when this feature is disabled, courses can still be exported to git with
# the git_export management command.
# .. toggle_warning: To enable this feature, the GIT_REPO_EXPORT_DIR setting must be properly defined and point to an
# existing directory.
# .. toggle_use_cases: open_edx
# .. toggle_creation_date: 2014-02-13
EXPORT_GIT = SettingToggle(
"ENABLE_EXPORT_GIT", default=False, module_name=__name__
)
# Namespace for studio dashboard waffle flags.
CONTENTSTORE_NAMESPACE = 'contentstore'
CONTENTSTORE_LOG_PREFIX = 'Contentstore: '
# .. toggle_name: contentstore.split_library_on_studio_dashboard
# .. toggle_implementation: WaffleFlag
# .. toggle_default: False
# .. toggle_description: Enables data new view for library on studio dashboard.
# .. toggle_use_cases: open_edx
# .. toggle_creation_date: 2020-07-8
# .. toggle_tickets: TNL-7536
SPLIT_LIBRARY_ON_DASHBOARD = WaffleFlag(
f'{CONTENTSTORE_NAMESPACE}.split_library_on_studio_dashboard',
__name__,
CONTENTSTORE_LOG_PREFIX,
)
# .. toggle_name: contentstore.bypass_olx_failure
# .. toggle_implementation: WaffleFlag
# .. toggle_default: False
# .. toggle_description: Enables bypassing olx validation failures during course import.
# .. toggle_use_cases: open_edx
# .. toggle_creation_date: 2021-04-15
# .. toggle_target_removal_date: 2021-05-15
# .. toggle_tickets: TNL-8214
BYPASS_OLX_FAILURE = WaffleFlag(
f'{CONTENTSTORE_NAMESPACE}.bypass_olx_failure',
__name__,
CONTENTSTORE_LOG_PREFIX,
)
def split_library_view_on_dashboard():
"""
check if data new view for library is enabled on studio dashboard.
"""
return SPLIT_LIBRARY_ON_DASHBOARD.is_enabled()
def bypass_olx_failure_enabled():
"""
Check if bypass is enabled for course olx validation errors.
"""
return BYPASS_OLX_FAILURE.is_enabled()
# .. toggle_name: legacy_studio.exam_settings
# .. toggle_implementation: WaffleFlag
# .. toggle_default: False
# .. toggle_description: Temporarily fall back to the old proctored exam settings view.
# .. toggle_use_cases: temporary
# .. toggle_creation_date: 2025-03-14
# .. toggle_target_removal_date: 2025-09-14
# .. toggle_tickets: https://github.com/openedx/edx-platform/issues/36275
# .. toggle_warning: In Ulmo, this toggle will be removed. Only the new (React-based) experience will be available.
LEGACY_STUDIO_EXAM_SETTINGS = CourseWaffleFlag("legacy_studio.exam_settings", __name__)
def exam_setting_view_enabled(course_key):
"""
Returns a boolean if proctoring exam setting mfe view is enabled.
"""
return not LEGACY_STUDIO_EXAM_SETTINGS.is_enabled(course_key)
# .. toggle_name: legacy_studio.video_editor
# .. toggle_implementation: WaffleFlag
# .. toggle_default: False
# .. toggle_description: Temporarily fall back to the old Video component (a.k.a. video block) editor.
# .. toggle_use_cases: temporary
# .. toggle_creation_date: 2025-03-14
# .. toggle_target_removal_date: 2025-09-14
# .. toggle_tickets: https://github.com/openedx/edx-platform/issues/36275
# .. toggle_warning: In Ulmo, this toggle will be removed. Only the new (React-based) experience will be available.
LEGACY_STUDIO_VIDEO_EDITOR = CourseWaffleFlag('legacy_studio.video_editor', __name__)
def use_new_video_editor(course_key):
"""
Returns a boolean = true if new video editor is enabled
"""
return not LEGACY_STUDIO_VIDEO_EDITOR.is_enabled(course_key)
# .. toggle_name: legacy_studio.pdf_editor
# .. toggle_implementation: WaffleFlag
# .. toggle_default: False
# .. toggle_description: Use the PDF XBlock's studio_view instead of the new React-based editor. You may wish to do
# this if you run a custom PDF block.
# .. toggle_use_cases: opt_out
# .. toggle_creation_date: 2026-03-10
LEGACY_STUDIO_PDF_EDITOR = WaffleFlag('legacy_studio.pdf_editor', __name__)
def use_new_pdf_editor():
"""
Returns a boolean = true if new video editor is enabled
"""
return not LEGACY_STUDIO_PDF_EDITOR.is_enabled()
# .. toggle_name: new_core_editors.use_video_gallery_flow
# .. toggle_implementation: WaffleFlag
# .. toggle_default: False
# .. toggle_description: This flag enables the use the video selection gallery on the flow of the new core video xblock editor
# .. toggle_use_cases: temporary
# .. toggle_creation_date: 2023-04-03
# .. toggle_target_removal_date: 2023-6-01
# .. toggle_warning: You need to activate the `new_core_editors.use_new_video_editor` flag to use this new flow.
ENABLE_VIDEO_GALLERY_FLOW_FLAG = WaffleFlag('new_core_editors.use_video_gallery_flow', __name__)
def use_video_gallery_flow():
"""
Returns a boolean = true if the video gallery flow is enabled
"""
return ENABLE_VIDEO_GALLERY_FLOW_FLAG.is_enabled()
# .. toggle_name: contentstore.individualize_anonymous_user_id
# .. toggle_implementation: CourseWaffleFlag
# .. toggle_default: False
# .. toggle_description: This flag enables the use of unique anonymous_user_id during studio preview
# .. toggle_use_cases: temporary
# .. toggle_creation_date: 2022-05-04
# .. toggle_target_removal_date: 2022-05-30
# .. toggle_tickets: MST-1455
INDIVIDUALIZE_ANONYMOUS_USER_ID = CourseWaffleFlag(
f'{CONTENTSTORE_NAMESPACE}.individualize_anonymous_user_id', __name__
)
def individualize_anonymous_user_id(course_id):
"""
Returns a boolean if individualized anonymous_user_id is enabled on the course
"""
return INDIVIDUALIZE_ANONYMOUS_USER_ID.is_enabled(course_id)
# .. toggle_name: contentstore.use_react_markdown_editor
# .. toggle_implementation: CourseWaffleFlag
# .. toggle_default: False
# .. toggle_description: This flag enables the use of the Markdown editor when creating or editing problems in the authoring MFE
# .. toggle_use_cases: opt_in
# .. toggle_creation_date: 2025-4-11
# .. toggle_tickets: https://openedx.atlassian.net/wiki/spaces/OEPM/pages/4517232656/Re-enable+Markdown+editing+of+CAPA+problems+to+meet+various+use+cases
ENABLE_REACT_MARKDOWN_EDITOR = CourseWaffleFlag(
f'{CONTENTSTORE_NAMESPACE}.use_react_markdown_editor', __name__)
def use_react_markdown_editor(course_key):
"""
Returns a boolean if new studio custom pages mfe is enabled
"""
return ENABLE_REACT_MARKDOWN_EDITOR.is_enabled(course_key)
# .. toggle_name: legacy_studio.schedule_details
# .. toggle_implementation: WaffleFlag
# .. toggle_default: False
# .. toggle_description: Temporarily fall back to the old Studio Schedule & Details page.
# .. toggle_use_cases: temporary
# .. toggle_creation_date: 2025-03-14
# .. toggle_target_removal_date: 2025-09-14
# .. toggle_tickets: https://github.com/openedx/edx-platform/issues/36275
# .. toggle_warning: In Ulmo, this toggle will be removed. Only the new (React-based) experience will be available.
LEGACY_STUDIO_SCHEDULE_DETAILS = CourseWaffleFlag('legacy_studio.schedule_details', __name__)
def use_new_schedule_details_page(course_key):
"""
Returns a boolean if new studio schedule and details mfe is enabled
"""
return not LEGACY_STUDIO_SCHEDULE_DETAILS.is_enabled(course_key)
# .. toggle_name: legacy_studio.advanced_settings
# .. toggle_implementation: WaffleFlag
# .. toggle_default: False
# .. toggle_description: Temporarily fall back to the old Studio Advanced Settings page.
# .. toggle_use_cases: temporary
# .. toggle_creation_date: 2025-03-14
# .. toggle_target_removal_date: 2025-09-14
# .. toggle_tickets: https://github.com/openedx/edx-platform/issues/36275
# .. toggle_warning: In Ulmo, this toggle will be removed. Only the new (React-based) experience will be available.
LEGACY_STUDIO_ADVANCED_SETTINGS = CourseWaffleFlag('legacy_studio.advanced_settings', __name__)
def use_new_advanced_settings_page(course_key):
"""
Returns a boolean if new studio advanced settings pafe mfe is enabled
"""
return not LEGACY_STUDIO_ADVANCED_SETTINGS.is_enabled(course_key)
# .. toggle_name: legacy_studio.grading
# .. toggle_implementation: WaffleFlag
# .. toggle_default: False
# .. toggle_description: Temporarily fall back to the old Studio Course Grading page.
# .. toggle_use_cases: temporary
# .. toggle_creation_date: 2025-03-14
# .. toggle_target_removal_date: 2025-09-14
# .. toggle_tickets: https://github.com/openedx/edx-platform/issues/36275
# .. toggle_warning: In Ulmo, this toggle will be removed. Only the new (React-based) experience will be available.
LEGACY_STUDIO_GRADING = CourseWaffleFlag('legacy_studio.grading', __name__)
def use_new_grading_page(course_key):
"""
Returns a boolean if new studio grading mfe is enabled
"""
return not LEGACY_STUDIO_GRADING.is_enabled(course_key)
# .. toggle_name: legacy_studio.import
# .. toggle_implementation: WaffleFlag
# .. toggle_default: False
# .. toggle_description: Temporarily fall back to the old Course Import page.
# .. toggle_use_cases: temporary
# .. toggle_creation_date: 2025-03-14
# .. toggle_target_removal_date: 2025-09-14
# .. toggle_tickets: https://github.com/openedx/edx-platform/issues/36275
# .. toggle_warning: In Ulmo, this toggle will be removed. Only the new (React-based) experience will be available.
LEGACY_STUDIO_IMPORT = CourseWaffleFlag('legacy_studio.import', __name__)
def use_new_import_page(course_key):
"""
Returns a boolean if new studio import mfe is enabled
"""
return not LEGACY_STUDIO_IMPORT.is_enabled(course_key)
# .. toggle_name: legacy_studio.export
# .. toggle_implementation: WaffleFlag
# .. toggle_default: False
# .. toggle_description: Temporarily fall back to the old Course Export page.
# .. toggle_use_cases: temporary
# .. toggle_creation_date: 2025-03-14
# .. toggle_target_removal_date: 2025-09-14
# .. toggle_tickets: https://github.com/openedx/edx-platform/issues/36275
# .. toggle_warning: In Ulmo, this toggle will be removed. Only the new (React-based) experience will be available.
LEGACY_STUDIO_EXPORT = CourseWaffleFlag('legacy_studio.export', __name__)
def use_new_export_page(course_key):
"""
Returns a boolean if new studio export mfe is enabled
"""
return not LEGACY_STUDIO_EXPORT.is_enabled(course_key)
# .. toggle_name: contentstore.new_studio_mfe.use_new_video_uploads_page
# .. toggle_implementation: CourseWaffleFlag
# .. toggle_default: False
# .. toggle_description: This flag enables the use of the new studio video uploads page MFE.
# Note: This page only works on edx.org or other sites that have reverse-engineered
# the edX video pipeline. It is off by default for the community.
# .. toggle_use_cases: opt_in
# .. toggle_creation_date: 2023-05-15
# .. toggle_tickets: https://github.com/openedx/openedx-platform/issues/37972
ENABLE_NEW_STUDIO_VIDEO_UPLOADS_PAGE = CourseWaffleFlag(
f'{CONTENTSTORE_NAMESPACE}.new_studio_mfe.use_new_video_uploads_page', __name__)
def use_new_video_uploads_page(course_key):
"""
Returns a boolean if new studio video uploads MFE is enabled.
This is off by default because the video uploads page requires the edX
video pipeline which is not available to the open source community.
"""
return ENABLE_NEW_STUDIO_VIDEO_UPLOADS_PAGE.is_enabled(course_key)
# .. toggle_name: legacy_studio.course_outline
# .. toggle_implementation: WaffleFlag
# .. toggle_default: False
# .. toggle_description: Temporarily fall back to the old Studio Course Outline editor.
# .. toggle_use_cases: temporary
# .. toggle_creation_date: 2025-03-14
# .. toggle_target_removal_date: 2025-09-14
# .. toggle_tickets: https://github.com/openedx/edx-platform/issues/36275
# .. toggle_warning: In Ulmo, this toggle will be removed. Only the new (React-based) experience will be available.
LEGACY_STUDIO_COURSE_OUTLINE = CourseWaffleFlag('legacy_studio.course_outline', __name__)
# .. toggle_name: legacy_studio.unit_editor
# .. toggle_implementation: WaffleFlag
# .. toggle_default: False
# .. toggle_description: Temporarily fall back to the old Studio unit editing page.
# .. toggle_use_cases: temporary
# .. toggle_creation_date: 2025-03-14
# .. toggle_target_removal_date: 2025-09-14
# .. toggle_tickets: https://github.com/openedx/edx-platform/issues/36275
# .. toggle_warning: In Ulmo, this toggle will be removed. Only the new (React-based) experience will be available.
LEGACY_STUDIO_UNIT_EDITOR = CourseWaffleFlag('legacy_studio.unit_editor', __name__)
def use_new_unit_page(course_key):
"""
Returns a boolean if new studio course outline mfe is enabled
"""
return not LEGACY_STUDIO_UNIT_EDITOR.is_enabled(course_key)
# .. toggle_name: legacy_studio.course_team
# .. toggle_implementation: WaffleFlag
# .. toggle_default: False
# .. toggle_description: Temporarily fall back to the old Studio Course Team page.
# .. toggle_use_cases: temporary
# .. toggle_creation_date: 2025-03-14
# .. toggle_target_removal_date: 2025-09-14
# .. toggle_tickets: https://github.com/openedx/edx-platform/issues/36275
# .. toggle_warning: In Ulmo, this toggle will be removed. Only the new (React-based) experience will be available.
LEGACY_STUDIO_COURSE_TEAM = CourseWaffleFlag('legacy_studio.course_team', __name__)
def use_new_course_team_page(course_key):
"""
Returns a boolean if new studio course team mfe is enabled
"""
return not LEGACY_STUDIO_COURSE_TEAM.is_enabled(course_key)
# .. toggle_name: legacy_studio.certificates
# .. toggle_implementation: WaffleFlag
# .. toggle_default: False
# .. toggle_description: Temporarily fall back to the old Studio Course Certificates page.
# .. toggle_use_cases: temporary
# .. toggle_creation_date: 2025-03-14
# .. toggle_target_removal_date: 2025-09-14
# .. toggle_tickets: https://github.com/openedx/edx-platform/issues/36275
# .. toggle_warning: In Ulmo, this toggle will be removed. Only the new (React-based) experience will be available.
LEGACY_STUDIO_CERTIFICATES = CourseWaffleFlag('legacy_studio.certificates', __name__)
def use_new_certificates_page(course_key):
"""
Returns a boolean if new studio certificates mfe is enabled
"""
return not LEGACY_STUDIO_CERTIFICATES.is_enabled(course_key)
# .. toggle_name: legacy_studio.configurations
# .. toggle_implementation: WaffleFlag
# .. toggle_default: False
# .. toggle_description: Temporarily fall back to the old Studio Configurations page.
# .. toggle_use_cases: temporary
# .. toggle_creation_date: 2025-03-14
# .. toggle_target_removal_date: 2025-09-14
# .. toggle_tickets: https://github.com/openedx/edx-platform/issues/36275
# .. toggle_warning: In Ulmo, this toggle will be removed. Only the new (React-based) experience will be available.
LEGACY_STUDIO_CONFIGURATIONS = CourseWaffleFlag('legacy_studio.configurations', __name__)
def use_new_group_configurations_page(course_key):
"""
Returns a boolean if new studio group configurations mfe is enabled
"""
return not LEGACY_STUDIO_CONFIGURATIONS.is_enabled(course_key)
# .. toggle_name: contentstore.mock_video_uploads
# .. toggle_implementation: WaffleFlag
# .. toggle_default: False
# .. toggle_description: This flag mocks contentstore video uploads for local development, if you don't have access to AWS
# .. toggle_use_cases: open_edx
# .. toggle_creation_date: 2023-7-25
# .. toggle_tickets: TNL-10897
# .. toggle_warning:
MOCK_VIDEO_UPLOADS = WaffleFlag(
f'{CONTENTSTORE_NAMESPACE}.mock_video_uploads', __name__)
def use_mock_video_uploads():
"""
Returns a boolean if video uploads should be mocked for local development
"""
return MOCK_VIDEO_UPLOADS.is_enabled()
# .. toggle_name: contentstore.default_enable_flexible_peer_openassessments
# .. toggle_implementation: CourseWaffleFlag
# .. toggle_default: False
# .. toggle_description: This flag turns on the force_on_flexible_peer_openassessments
# setting for course reruns or new courses, where enabled.
# .. toggle_use_cases: temporary
# .. toggle_creation_date: 2023-06-27
# .. toggle_target_removal_date: 2024-01-27
# .. toggle_tickets: AU-1289
# .. toggle_warning:
DEFAULT_ENABLE_FLEXIBLE_PEER_OPENASSESSMENTS = CourseWaffleFlag(
f'{CONTENTSTORE_NAMESPACE}.default_enable_flexible_peer_openassessments', __name__)
def default_enable_flexible_peer_openassessments(course_key):
"""
Returns a boolean if ORA flexible peer grading should be toggled on for a
course rerun or new course. We expect this to be set at the organization
level to opt in/out of rolling forward this feature.
"""
return DEFAULT_ENABLE_FLEXIBLE_PEER_OPENASSESSMENTS.is_enabled(course_key)
# .. toggle_name: ENABLE_CONTENT_LIBRARIES
# .. toggle_implementation: SettingToggle
# .. toggle_default: True
# .. toggle_description: Enables use of the legacy and v2 libraries waffle flags.
# Note that legacy content libraries are only supported in courses using split mongo.
# .. toggle_use_cases: open_edx
# .. toggle_creation_date: 2015-03-06
# .. toggle_target_removal_date: 2025-04-09
# .. toggle_warning: This flag is deprecated in Sumac, and will be removed in favor of the disable_legacy_libraries and
# disable_new_libraries waffle flags.
ENABLE_CONTENT_LIBRARIES = SettingToggle(
"ENABLE_CONTENT_LIBRARIES", default=True, module_name=__name__
)
# .. toggle_name: contentstore.new_studio_mfe.disable_legacy_libraries
# .. toggle_implementation: WaffleFlag
# .. toggle_default: False
# .. toggle_description: Hides legacy (v1) Libraries tab in Authoring MFE.
# This toggle interacts with ENABLE_CONTENT_LIBRARIES toggle: if this is disabled, then legacy libraries are also
# disabled.
# .. toggle_use_cases: open_edx
# .. toggle_creation_date: 2024-10-02
# .. toggle_target_removal_date: 2025-04-09
# .. toggle_tickets: https://github.com/openedx/frontend-app-authoring/issues/1334
# .. toggle_warning: Legacy libraries are deprecated in Sumac, cf https://github.com/openedx/edx-platform/issues/32457
DISABLE_LEGACY_LIBRARIES = WaffleFlag(
f'{CONTENTSTORE_NAMESPACE}.new_studio_mfe.disable_legacy_libraries',
__name__,
CONTENTSTORE_LOG_PREFIX,
)
def libraries_v1_enabled():
"""
Returns a boolean if Libraries V2 is enabled in the new Studio Home.
"""
return (
ENABLE_CONTENT_LIBRARIES.is_enabled() and
not DISABLE_LEGACY_LIBRARIES.is_enabled()
)
# .. toggle_name: contentstore.new_studio_mfe.disable_new_libraries
# .. toggle_implementation: WaffleFlag
# .. toggle_default: False
# .. toggle_description: Hides new Libraries v2 tab in Authoring MFE.
# This toggle interacts with settings.MEILISEARCH_ENABLED and ENABLE_CONTENT_LIBRARIES toggle: if these flags are
# False, then v2 libraries are also disabled.
# .. toggle_use_cases: open_edx
# .. toggle_creation_date: 2024-10-02
# .. toggle_target_removal_date: 2025-04-09
# .. toggle_tickets: https://github.com/openedx/frontend-app-authoring/issues/1334
# .. toggle_warning: Libraries v2 are in beta for Sumac, will be fully supported in Teak.
DISABLE_NEW_LIBRARIES = WaffleFlag(
f'{CONTENTSTORE_NAMESPACE}.new_studio_mfe.disable_new_libraries',
__name__,
CONTENTSTORE_LOG_PREFIX,
)
def libraries_v2_enabled():
"""
Returns a boolean if Libraries V2 is enabled in the new Studio Home.
Requires the ENABLE_CONTENT_LIBRARIES feature flag to be enabled, plus Meilisearch.
"""
return (
ENABLE_CONTENT_LIBRARIES.is_enabled() and
search_api.is_meilisearch_enabled() and
not DISABLE_NEW_LIBRARIES.is_enabled()
)
# .. toggle_name: contentstore.enable_course_optimizer
# .. toggle_implementation: CourseWaffleFlag
# .. toggle_default: False
# .. toggle_description: This flag enables the course optimizer tool in the authoring MFE.
# .. toggle_use_cases: temporary
# .. toggle_creation_date: 2025-01-17
# .. toggle_target_removal_date: 2025-05-30
# .. toggle_tickets: TNL-11837
ENABLE_COURSE_OPTIMIZER = CourseWaffleFlag(
f'{CONTENTSTORE_NAMESPACE}.enable_course_optimizer', __name__
)
def enable_course_optimizer(course_id):
"""
Returns a boolean if course optimizer is enabled on the course
"""
return ENABLE_COURSE_OPTIMIZER.is_enabled(course_id)
# .. toggle_name: legacy_studio.logged_out_home
# .. toggle_implementation: WaffleFlag
# .. toggle_default: False
# .. toggle_description: Temporarily fall back to the old Studio "How it Works" page when unauthenticated
# .. toggle_use_cases: temporary
# .. toggle_creation_date: 2025-03-14
# .. toggle_target_removal_date: 2025-09-14
# .. toggle_tickets: https://github.com/openedx/edx-platform/issues/36275
# .. toggle_warning: In Ulmo, this toggle will be removed, along with the legacy page. The only available
# behavior will be to send the user to the log-in page with a redirect to Studio Course Listing (/home).
LEGACY_STUDIO_LOGGED_OUT_HOME = WaffleFlag('legacy_studio.logged_out_home', __name__)
def use_legacy_logged_out_home():
"""
Returns whether the old "how it works" page should be shown.
If not, then we should just go to the login page w/ redirect to studio course listing.
"""
return LEGACY_STUDIO_LOGGED_OUT_HOME.is_enabled()
# .. toggle_name: contentstore.enable_course_optimizer_check_prev_run_links
# .. toggle_implementation: CourseWaffleFlag
# .. toggle_default: False
# .. toggle_description: When enabled, allows the Course Optimizer to detect and update links pointing to previous course runs.
# This feature enables instructors to fix internal course links that still point to old course runs
# after creating a course rerun.
# .. toggle_use_cases: temporary
# .. toggle_creation_date: 2025-07-21
# .. toggle_target_removal_date: 2026-02-25
ENABLE_COURSE_OPTIMIZER_CHECK_PREV_RUN_LINKS = CourseWaffleFlag(
f'{CONTENTSTORE_NAMESPACE}.enable_course_optimizer_check_prev_run_links',
__name__,
CONTENTSTORE_LOG_PREFIX,
)
def enable_course_optimizer_check_prev_run_links(course_key):
"""
Returns a boolean if previous run course optimizer feature is enabled for the given course.
"""
return ENABLE_COURSE_OPTIMIZER_CHECK_PREV_RUN_LINKS.is_enabled(course_key)