diff --git a/.github/workflows/unit-tests.yml b/.github/workflows/unit-tests.yml index 58cd39a80868..79a59d2a0f19 100644 --- a/.github/workflows/unit-tests.yml +++ b/.github/workflows/unit-tests.yml @@ -20,6 +20,7 @@ jobs: name: ${{ matrix.shard_name }}(py=${{ matrix.python-version }},dj=${{ matrix.django-version }},mongo=${{ matrix.mongo-version }}) runs-on: ${{ matrix.os-version }} strategy: + fail-fast: false matrix: python-version: - "3.11" diff --git a/cms/djangoapps/cms_user_tasks/tests.py b/cms/djangoapps/cms_user_tasks/tests.py index 8a9bc5532101..d87aeaedb6d3 100644 --- a/cms/djangoapps/cms_user_tasks/tests.py +++ b/cms/djangoapps/cms_user_tasks/tests.py @@ -277,7 +277,7 @@ def test_email_sent_with_olx_validations_with_default_config(self): msg = mail.outbox[0] # Verify olx validation is not enabled out of the box. - self.assertFalse(settings.FEATURES.get('ENABLE_COURSE_OLX_VALIDATION')) + self.assertFalse(settings.ENABLE_COURSE_OLX_VALIDATION) self.assertEqual(len(mail.outbox), 1) self.assert_msg_subject(msg) self.assert_msg_body_fragments(msg, body_fragments) diff --git a/cms/djangoapps/contentstore/courseware_index.py b/cms/djangoapps/contentstore/courseware_index.py index b7b74992035a..7dd35f820301 100644 --- a/cms/djangoapps/contentstore/courseware_index.py +++ b/cms/djangoapps/contentstore/courseware_index.py @@ -49,7 +49,7 @@ def indexing_is_enabled(): """ Checks to see if the indexing feature is enabled """ - return settings.FEATURES.get('ENABLE_COURSEWARE_INDEX', False) + return settings.ENABLE_COURSEWARE_INDEX class SearchIndexingError(Exception): diff --git a/cms/djangoapps/contentstore/exams.py b/cms/djangoapps/contentstore/exams.py index 8a4ddc09425e..d54f5233d441 100644 --- a/cms/djangoapps/contentstore/exams.py +++ b/cms/djangoapps/contentstore/exams.py @@ -27,7 +27,7 @@ def register_exams(course_key): Likewise, if formerly registered exams are not included in the payload they will be marked inactive by the exam service. """ - if not settings.FEATURES.get('ENABLE_SPECIAL_EXAMS') or not exams_ida_enabled(course_key): + if not settings.ENABLE_SPECIAL_EXAMS or not exams_ida_enabled(course_key): # if feature is not enabled then do a quick exit return diff --git a/cms/djangoapps/contentstore/management/commands/reindex_course.py b/cms/djangoapps/contentstore/management/commands/reindex_course.py index 0bd52b6cc16e..ba0acb5fc308 100644 --- a/cms/djangoapps/contentstore/management/commands/reindex_course.py +++ b/cms/djangoapps/contentstore/management/commands/reindex_course.py @@ -143,7 +143,7 @@ def handle(self, *args, **options): # pylint: disable=too-many-statements all_courses = modulestore().get_courses() inclusion_date = datetime.strptime( - settings.FEATURES.get('COURSEWARE_SEARCH_INCLUSION_DATE', '2020-01-01'), + settings.COURSEWARE_SEARCH_INCLUSION_DATE or '2020-01-01', '%Y-%m-%d' ) diff --git a/cms/djangoapps/contentstore/proctoring.py b/cms/djangoapps/contentstore/proctoring.py index bd33049006c4..bd2f9bf5a0a0 100644 --- a/cms/djangoapps/contentstore/proctoring.py +++ b/cms/djangoapps/contentstore/proctoring.py @@ -35,7 +35,7 @@ def register_special_exams(course_key): subsystem. Likewise, if formerly registered exams are unmarked, then those registered exams are marked as inactive """ - if not settings.FEATURES.get('ENABLE_SPECIAL_EXAMS'): + if not settings.ENABLE_SPECIAL_EXAMS: # if feature is not enabled then do a quick exit return diff --git a/cms/djangoapps/contentstore/rest_api/v1/views/grading.py b/cms/djangoapps/contentstore/rest_api/v1/views/grading.py index 9275fecb58ab..90e7508d14e2 100644 --- a/cms/djangoapps/contentstore/rest_api/v1/views/grading.py +++ b/cms/djangoapps/contentstore/rest_api/v1/views/grading.py @@ -96,7 +96,7 @@ def get(self, request: Request, course_id: str): self.permission_denied(request) with modulestore().bulk_operations(course_key): - credit_eligibility_enabled = settings.FEATURES.get("ENABLE_CREDIT_ELIGIBILITY", False) + credit_eligibility_enabled = settings.ENABLE_CREDIT_ELIGIBILITY show_credit_eligibility = is_credit_course(course_key) and credit_eligibility_enabled grading_context = get_course_grading(course_key) diff --git a/cms/djangoapps/contentstore/rest_api/v1/views/home.py b/cms/djangoapps/contentstore/rest_api/v1/views/home.py index 95723020c11f..3ae512ce3b14 100644 --- a/cms/djangoapps/contentstore/rest_api/v1/views/home.py +++ b/cms/djangoapps/contentstore/rest_api/v1/views/home.py @@ -90,7 +90,7 @@ def get(self, request: Request): ), 'studio_name': settings.STUDIO_NAME, 'studio_short_name': settings.STUDIO_SHORT_NAME, - 'studio_request_email': settings.FEATURES.get('STUDIO_REQUEST_EMAIL', ''), + 'studio_request_email': settings.STUDIO_REQUEST_EMAIL, 'tech_support_email': settings.TECH_SUPPORT_EMAIL, 'platform_name': settings.PLATFORM_NAME, 'user_is_active': request.user.is_active, diff --git a/cms/djangoapps/contentstore/rest_api/v1/views/proctoring.py b/cms/djangoapps/contentstore/rest_api/v1/views/proctoring.py index 28296513a5e6..01f65b0d2c5e 100644 --- a/cms/djangoapps/contentstore/rest_api/v1/views/proctoring.py +++ b/cms/djangoapps/contentstore/rest_api/v1/views/proctoring.py @@ -266,7 +266,7 @@ def get(self, request: Request, course_id: str) -> Response: course_block = modulestore().get_course(course_key) advanced_dict = CourseMetadata.fetch(course_block) - if settings.FEATURES.get('DISABLE_MOBILE_COURSE_AVAILABLE', False): + if settings.DISABLE_MOBILE_COURSE_AVAILABLE: advanced_dict.get('mobile_available')['deprecated'] = True proctoring_errors = CourseMetadata.validate_proctoring_settings(course_block, advanced_dict, request.user) diff --git a/cms/djangoapps/contentstore/rest_api/v1/views/settings.py b/cms/djangoapps/contentstore/rest_api/v1/views/settings.py index fbb05cba4de2..12903428f498 100644 --- a/cms/djangoapps/contentstore/rest_api/v1/views/settings.py +++ b/cms/djangoapps/contentstore/rest_api/v1/views/settings.py @@ -110,7 +110,7 @@ def get(self, request: Request, course_id: str): 'course_display_name': course_block.display_name, 'course_display_name_with_default': course_block.display_name_with_default, 'platform_name': settings.PLATFORM_NAME, - 'licensing_enabled': settings.FEATURES.get("LICENSING", False), + 'licensing_enabled': settings.LICENSING, }) serializer = CourseSettingsSerializer(settings_context) diff --git a/cms/djangoapps/contentstore/tests/test_course_settings.py b/cms/djangoapps/contentstore/tests/test_course_settings.py index 876bb37ee783..cbab9591e261 100644 --- a/cms/djangoapps/contentstore/tests/test_course_settings.py +++ b/cms/djangoapps/contentstore/tests/test_course_settings.py @@ -437,7 +437,7 @@ def test_marketing_site_fetch(self): self.assertNotContains(response, "Course Banner Image") self.assertNotContains(response, "Course Video Thumbnail Image") - @unittest.skipUnless(settings.FEATURES.get('ENTRANCE_EXAMS', False), True) + @unittest.skipUnless(settings.ENTRANCE_EXAMS, True) def test_entrance_exam_created_updated_and_deleted_successfully(self): """ This tests both of the entrance exam settings and the `any_unfulfilled_milestones` helper. @@ -503,7 +503,7 @@ def test_entrance_exam_created_updated_and_deleted_successfully(self): self.assertFalse(milestones_helpers.any_unfulfilled_milestones(self.course.id, self.user.id), msg='The entrance exam should not be required anymore') - @unittest.skipUnless(settings.FEATURES.get('ENTRANCE_EXAMS', False), True) + @unittest.skipUnless(settings.ENTRANCE_EXAMS, True) def test_entrance_exam_store_default_min_score(self): """ test that creating an entrance exam should store the default value, if key missing in json request @@ -557,7 +557,7 @@ def test_entrance_exam_store_default_min_score(self): self.assertTrue(course.entrance_exam_enabled) self.assertEqual(course.entrance_exam_minimum_score_pct, .5) - @unittest.skipUnless(settings.FEATURES.get('ENTRANCE_EXAMS', False), True) + @unittest.skipUnless(settings.ENTRANCE_EXAMS, True) @mock.patch.dict("django.conf.settings.FEATURES", {'ENABLE_PREREQUISITE_COURSES': True}) def test_entrance_after_changing_other_setting(self): """ diff --git a/cms/djangoapps/contentstore/toggles.py b/cms/djangoapps/contentstore/toggles.py index 7aadfe64e94d..90f3bf41d6d5 100644 --- a/cms/djangoapps/contentstore/toggles.py +++ b/cms/djangoapps/contentstore/toggles.py @@ -1,7 +1,9 @@ """ CMS feature toggles. """ +from django.conf import settings 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 @@ -409,25 +411,11 @@ def default_enable_flexible_peer_openassessments(course_key): 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 +# This toggle interacts with ENABLE_CONTENT_LIBRARIES setting: if this is disabled, then legacy libraries are also # disabled. # .. toggle_use_cases: open_edx # .. toggle_creation_date: 2024-10-02 @@ -446,7 +434,7 @@ def libraries_v1_enabled(): Returns a boolean if Libraries V2 is enabled in the new Studio Home. """ return ( - ENABLE_CONTENT_LIBRARIES.is_enabled() and + settings.ENABLE_CONTENT_LIBRARIES and not DISABLE_LEGACY_LIBRARIES.is_enabled() ) @@ -476,7 +464,7 @@ def libraries_v2_enabled(): Requires the ENABLE_CONTENT_LIBRARIES feature flag to be enabled, plus Meilisearch. """ return ( - ENABLE_CONTENT_LIBRARIES.is_enabled() and + settings.ENABLE_CONTENT_LIBRARIES and search_api.is_meilisearch_enabled() and not DISABLE_NEW_LIBRARIES.is_enabled() ) diff --git a/cms/djangoapps/contentstore/utils.py b/cms/djangoapps/contentstore/utils.py index f40fad42152c..a6c9cc6d36d9 100644 --- a/cms/djangoapps/contentstore/utils.py +++ b/cms/djangoapps/contentstore/utils.py @@ -571,7 +571,7 @@ def course_import_olx_validation_is_enabled(): """ Check if course olx validation is enabled on course import. """ - return settings.FEATURES.get('ENABLE_COURSE_OLX_VALIDATION', False) + return settings.ENABLE_COURSE_OLX_VALIDATION # pylint: disable=invalid-name @@ -1409,7 +1409,7 @@ def get_course_settings(request, course_key, course_block): from .views.course import get_courses_accessible_to_user, _process_courses_list - credit_eligibility_enabled = settings.FEATURES.get('ENABLE_CREDIT_ELIGIBILITY', False) + credit_eligibility_enabled = settings.ENABLE_CREDIT_ELIGIBILITY upload_asset_url = reverse_course_url('assets_handler', course_key) # see if the ORG of this course can be attributed to a defined configuration . In that case, the @@ -1417,17 +1417,17 @@ def get_course_settings(request, course_key, course_block): publisher_enabled = configuration_helpers.get_value_for_org( course_block.location.org, 'ENABLE_PUBLISHER', - settings.FEATURES.get('ENABLE_PUBLISHER', False) + settings.ENABLE_PUBLISHER ) marketing_enabled = configuration_helpers.get_value_for_org( course_block.location.org, 'ENABLE_MKTG_SITE', - settings.FEATURES.get('ENABLE_MKTG_SITE', False) + settings.ENABLE_MKTG_SITE ) enable_extended_course_details = configuration_helpers.get_value_for_org( course_block.location.org, 'ENABLE_EXTENDED_COURSE_DETAILS', - settings.FEATURES.get('ENABLE_EXTENDED_COURSE_DETAILS', False) + settings.ENABLE_EXTENDED_COURSE_DETAILS ) about_page_editable = not publisher_enabled @@ -1435,7 +1435,7 @@ def get_course_settings(request, course_key, course_block): short_description_editable = configuration_helpers.get_value_for_org( course_block.location.org, 'EDITABLE_SHORT_DESCRIPTION', - settings.FEATURES.get('EDITABLE_SHORT_DESCRIPTION', True) + settings.EDITABLE_SHORT_DESCRIPTION ) sidebar_html_enabled = ENABLE_COURSE_ABOUT_SIDEBAR_HTML.is_enabled() @@ -1623,9 +1623,9 @@ def get_library_context(request, request_is_json=False): 'user': request.user, 'request_course_creator_url': reverse('request_course_creator'), 'course_creator_status': _get_course_creator_status(request.user), - 'allow_unicode_course_id': settings.FEATURES.get('ALLOW_UNICODE_COURSE_ID', False), + 'allow_unicode_course_id': settings.ALLOW_UNICODE_COURSE_ID, 'archived_courses': True, - 'allow_course_reruns': settings.FEATURES.get('ALLOW_COURSE_RERUNS', True), + 'allow_course_reruns': settings.ALLOW_COURSE_RERUNS, 'rerun_creator_status': GlobalStaff().has_user(request.user), 'split_studio_home': split_library_view_on_dashboard(), 'active_tab': 'libraries', @@ -1670,7 +1670,7 @@ def format_in_process_course_view(uca): } courses_iter, in_process_course_actions = get_courses_accessible_to_user(request) - split_archived = settings.FEATURES.get('ENABLE_SEPARATE_ARCHIVED_COURSES', False) + split_archived = settings.ENABLE_SEPARATE_ARCHIVED_COURSES active_courses, archived_courses = _process_courses_list(courses_iter, in_process_course_actions, split_archived) in_process_course_actions = [format_in_process_course_view(uca) for uca in in_process_course_actions] return active_courses, archived_courses, in_process_course_actions @@ -1763,8 +1763,8 @@ def get_home_context(request, no_course=False): 'request_course_creator_url': reverse('request_course_creator'), 'course_creator_status': _get_course_creator_status(user), 'rerun_creator_status': GlobalStaff().has_user(user), - 'allow_unicode_course_id': settings.FEATURES.get('ALLOW_UNICODE_COURSE_ID', False), - 'allow_course_reruns': settings.FEATURES.get('ALLOW_COURSE_RERUNS', True), + 'allow_unicode_course_id': settings.ALLOW_UNICODE_COURSE_ID, + 'allow_course_reruns': settings.ALLOW_COURSE_RERUNS, 'active_tab': 'courses', 'allowed_organizations': get_allowed_organizations(user), 'allowed_organizations_for_libraries': get_allowed_organizations_for_libraries(user), @@ -1788,7 +1788,7 @@ def get_course_rerun_context(course_key, course_block, user): 'display_name': course_block.display_name, 'user': user, 'course_creator_status': _get_course_creator_status(user), - 'allow_unicode_course_id': settings.FEATURES.get('ALLOW_UNICODE_COURSE_ID', False) + 'allow_unicode_course_id': settings.ALLOW_UNICODE_COURSE_ID } return course_rerun_context @@ -1910,7 +1910,7 @@ def _get_course_index_context(request, course_key, course_block): lms_link = get_lms_link_for_item(course_block.location) reindex_link = None - if settings.FEATURES.get('ENABLE_COURSEWARE_INDEX', False): + if settings.ENABLE_COURSEWARE_INDEX: if GlobalStaff().has_user(request.user): reindex_link = f"/course/{str(course_key)}/search_reindex" sections = course_block.get_children() @@ -1936,7 +1936,7 @@ def _get_course_index_context(request, course_key, course_block): frontend_app_publisher_url = configuration_helpers.get_value_for_org( course_block.location.org, 'FRONTEND_APP_PUBLISHER_URL', - settings.FEATURES.get('FRONTEND_APP_PUBLISHER_URL', False) + settings.FRONTEND_APP_PUBLISHER_URL ) # gather any errors in the currently stored proctoring settings. advanced_dict = CourseMetadata.fetch(course_block) diff --git a/cms/djangoapps/contentstore/video_storage_handlers.py b/cms/djangoapps/contentstore/video_storage_handlers.py index 46215ae90362..26a745809f8d 100644 --- a/cms/djangoapps/contentstore/video_storage_handlers.py +++ b/cms/djangoapps/contentstore/video_storage_handlers.py @@ -577,7 +577,7 @@ def _get_and_validate_course(course_key_string, user): course = get_course_and_check_access(course_key, user) if ( - settings.FEATURES["ENABLE_VIDEO_UPLOAD_PIPELINE"] and + settings.ENABLE_VIDEO_UPLOAD_PIPELINE and getattr(settings, "VIDEO_UPLOAD_PIPELINE", None) and course and course.video_pipeline_configured diff --git a/cms/djangoapps/contentstore/views/certificate_manager.py b/cms/djangoapps/contentstore/views/certificate_manager.py index 081afdcc0dd7..6e7419a39dc7 100644 --- a/cms/djangoapps/contentstore/views/certificate_manager.py +++ b/cms/djangoapps/contentstore/views/certificate_manager.py @@ -122,7 +122,7 @@ def is_activated(course): """ is_active = False certificates = [] - if settings.FEATURES.get('CERTIFICATES_HTML_VIEW', False): + if settings.CERTIFICATES_HTML_VIEW: certificates = CertificateManager.get_certificates(course) # we are assuming only one certificate in certificates collection. for certificate in certificates: diff --git a/cms/djangoapps/contentstore/views/course.py b/cms/djangoapps/contentstore/views/course.py index bf2cd9cb83d6..7ba3d90f967e 100644 --- a/cms/djangoapps/contentstore/views/course.py +++ b/cms/djangoapps/contentstore/views/course.py @@ -883,7 +883,7 @@ def _create_or_rerun_course(request): raise PermissionDenied() # allow/disable unicode characters in course_id according to settings - if not settings.FEATURES.get('ALLOW_UNICODE_COURSE_ID'): + if not settings.ALLOW_UNICODE_COURSE_ID: if _has_non_ascii_characters(org) or _has_non_ascii_characters(course) or _has_non_ascii_characters(run): return JsonResponse( {'error': _('Special characters not allowed in organization, course number, and course run.')}, @@ -1285,7 +1285,7 @@ def advanced_settings_handler(request, course_key_string): course_block = get_course_and_check_access(course_key, request.user) advanced_dict = CourseMetadata.fetch(course_block) - if settings.FEATURES.get('DISABLE_MOBILE_COURSE_AVAILABLE', False): + if settings.DISABLE_MOBILE_COURSE_AVAILABLE: advanced_dict.get('mobile_available')['deprecated'] = True if 'text/html' in request.META.get('HTTP_ACCEPT', '') and request.method == 'GET': @@ -1294,7 +1294,7 @@ def advanced_settings_handler(request, course_key_string): publisher_enabled = configuration_helpers.get_value_for_org( course_block.location.org, 'ENABLE_PUBLISHER', - settings.FEATURES.get('ENABLE_PUBLISHER', False) + settings.ENABLE_PUBLISHER ) # gather any errors in the currently stored proctoring settings. proctoring_errors = CourseMetadata.validate_proctoring_settings(course_block, advanced_dict, request.user) @@ -1803,9 +1803,9 @@ def _get_course_creator_status(user): if user.is_staff: course_creator_status = 'granted' - elif settings.FEATURES.get('DISABLE_COURSE_CREATION', False): + elif settings.DISABLE_COURSE_CREATION: course_creator_status = 'disallowed_for_this_site' - elif settings.FEATURES.get('ENABLE_CREATOR_GROUP', False): + elif settings.ENABLE_CREATOR_GROUP: course_creator_status = get_course_creator_status(user) if course_creator_status is None: # User not grandfathered in as an existing user, has not previously visited the dashboard page. @@ -1822,7 +1822,7 @@ def get_allowed_organizations(user): """ Helper method for returning the list of organizations for which the user is allowed to create courses. """ - if settings.FEATURES.get('ENABLE_CREATOR_GROUP', False): + if settings.ENABLE_CREATOR_GROUP: return get_organizations(user) else: return [] @@ -1837,12 +1837,12 @@ def get_allowed_organizations_for_libraries(user): # This allows org-level staff to create libraries. We should re-evaluate # whether this is necessary and try to normalize course and library creation # authorization behavior. - if settings.FEATURES.get('ENABLE_ORGANIZATION_STAFF_ACCESS_FOR_CONTENT_LIBRARIES', False): + if settings.ENABLE_ORGANIZATION_STAFF_ACCESS_FOR_CONTENT_LIBRARIES: organizations_set.update(get_organizations_for_non_course_creators(user)) # This allows people in the course creator group for an org to create # libraries, which mimics course behavior. - if settings.FEATURES.get('ENABLE_CREATOR_GROUP', False): + if settings.ENABLE_CREATOR_GROUP: organizations_set.update(get_organizations(user)) return sorted(organizations_set) @@ -1852,7 +1852,7 @@ def user_can_create_organizations(user): """ Returns True if the user can create organizations. """ - return user.is_staff or not settings.FEATURES.get('ENABLE_CREATOR_GROUP', False) + return user.is_staff or not settings.ENABLE_CREATOR_GROUP def get_organizations_for_non_course_creators(user): diff --git a/cms/djangoapps/contentstore/views/library.py b/cms/djangoapps/contentstore/views/library.py index 92e4329c2f94..09f90c10aa42 100644 --- a/cms/djangoapps/contentstore/views/library.py +++ b/cms/djangoapps/contentstore/views/library.py @@ -72,7 +72,7 @@ def _user_can_create_library_for_org(user, org=None): return False elif user.is_staff: return True - elif settings.FEATURES.get('ENABLE_CREATOR_GROUP', False): + elif settings.ENABLE_CREATOR_GROUP: org_filter_params = {} if org: org_filter_params['org'] = org @@ -93,8 +93,8 @@ def _user_can_create_library_for_org(user, org=None): return is_course_creator or has_org_staff_role or has_course_staff_role or has_course_admin_role else: # EDUCATOR-1924: DISABLE_LIBRARY_CREATION overrides DISABLE_COURSE_CREATION, if present. - disable_library_creation = settings.FEATURES.get('DISABLE_LIBRARY_CREATION', None) - disable_course_creation = settings.FEATURES.get('DISABLE_COURSE_CREATION', False) + disable_library_creation = settings.DISABLE_LIBRARY_CREATION + disable_course_creation = settings.DISABLE_COURSE_CREATION if disable_library_creation is not None: return not disable_library_creation else: diff --git a/cms/djangoapps/contentstore/views/preview.py b/cms/djangoapps/contentstore/views/preview.py index 6600430a7a89..c7e7f70bce65 100644 --- a/cms/djangoapps/contentstore/views/preview.py +++ b/cms/djangoapps/contentstore/views/preview.py @@ -191,7 +191,7 @@ def _prepare_runtime_for_preview(request, block): ] mako_service = MakoService(namespace_prefix='lms.') - if settings.FEATURES.get("LICENSING", False): + if settings.LICENSING: # stick the license wrapper in front wrappers.insert(0, partial(wrap_with_license, mako_service=mako_service)) diff --git a/cms/djangoapps/contentstore/views/tests/test_videos.py b/cms/djangoapps/contentstore/views/tests/test_videos.py index e42ef2198c8d..a950927fe135 100644 --- a/cms/djangoapps/contentstore/views/tests/test_videos.py +++ b/cms/djangoapps/contentstore/views/tests/test_videos.py @@ -217,7 +217,7 @@ class VideoPipelineStudioAccessTestsMixin: Access tests for video views that rely on the video pipeline """ def test_video_pipeline_not_enabled(self): - settings.FEATURES["ENABLE_VIDEO_UPLOAD_PIPELINE"] = False + settings.ENABLE_VIDEO_UPLOAD_PIPELINE = False self.assertEqual(self.client.get(self.url).status_code, 404) def test_video_pipeline_not_configured(self): diff --git a/cms/djangoapps/contentstore/xblock_storage_handlers/view_handlers.py b/cms/djangoapps/contentstore/xblock_storage_handlers/view_handlers.py index f7c96d588a2e..f2d6f15fa828 100644 --- a/cms/djangoapps/contentstore/xblock_storage_handlers/view_handlers.py +++ b/cms/djangoapps/contentstore/xblock_storage_handlers/view_handlers.py @@ -1230,7 +1230,7 @@ def create_xblock_info( # lint-amnesty, pylint: disable=too-many-statements "user_partitions": user_partitions, "show_correctness": xblock.show_correctness, "hide_from_toc": xblock.hide_from_toc, - "enable_hide_from_toc_ui": settings.FEATURES.get("ENABLE_HIDE_FROM_TOC_UI", False), + "enable_hide_from_toc_ui": settings.ENABLE_HIDE_FROM_TOC_UI, "xblock_type": get_icon(xblock), } ) @@ -1268,7 +1268,7 @@ def create_xblock_info( # lint-amnesty, pylint: disable=too-many-statements ) # update xblock_info with special exam information if the feature flag is enabled - if settings.FEATURES.get("ENABLE_SPECIAL_EXAMS"): + if settings.ENABLE_SPECIAL_EXAMS: if xblock.category == "course": xblock_info.update( { diff --git a/cms/djangoapps/course_creators/admin.py b/cms/djangoapps/course_creators/admin.py index a1d34b3897fc..e6f0cb540265 100644 --- a/cms/djangoapps/course_creators/admin.py +++ b/cms/djangoapps/course_creators/admin.py @@ -142,7 +142,7 @@ def send_user_notification_callback(sender, **kwargs): # pylint: disable=unused user = kwargs['user'] updated_state = kwargs['state'] - studio_request_email = settings.FEATURES.get('STUDIO_REQUEST_EMAIL', '') + studio_request_email = settings.STUDIO_REQUEST_EMAIL context = {'studio_request_email': studio_request_email} subject = render_to_string('emails/course_creator_subject.txt', context) @@ -169,7 +169,7 @@ def send_admin_notification_callback(sender, **kwargs): # pylint: disable=unuse """ user = kwargs['user'] - studio_request_email = settings.FEATURES.get('STUDIO_REQUEST_EMAIL', '') + studio_request_email = settings.STUDIO_REQUEST_EMAIL context = {'user_name': user.username, 'user_email': user.email} subject = render_to_string('emails/course_creator_admin_subject.txt', context) diff --git a/cms/djangoapps/models/settings/course_metadata.py b/cms/djangoapps/models/settings/course_metadata.py index c66f5b65e4c9..6c5d7ff3f641 100644 --- a/cms/djangoapps/models/settings/course_metadata.py +++ b/cms/djangoapps/models/settings/course_metadata.py @@ -103,19 +103,19 @@ def get_exclude_list_of_fields(cls, course_key): exclude_list.append('giturl') # Do not show edxnotes if the feature is disabled. - if not settings.FEATURES.get('ENABLE_EDXNOTES'): + if not settings.ENABLE_EDXNOTES: exclude_list.append('edxnotes') # Do not show video auto advance if the feature is disabled - if not settings.FEATURES.get('ENABLE_OTHER_COURSE_SETTINGS'): + if not settings.ENABLE_OTHER_COURSE_SETTINGS: exclude_list.append('other_course_settings') # Do not show video_upload_pipeline if the feature is disabled. - if not settings.FEATURES.get('ENABLE_VIDEO_UPLOAD_PIPELINE'): + if not settings.ENABLE_VIDEO_UPLOAD_PIPELINE: exclude_list.append('video_upload_pipeline') # Do not show video auto advance if the feature is disabled - if not settings.FEATURES.get('ENABLE_AUTOADVANCE_VIDEOS'): + if not settings.ENABLE_AUTOADVANCE_VIDEOS: exclude_list.append('video_auto_advance') # Do not show social sharing url field if the feature is disabled. @@ -124,14 +124,14 @@ def get_exclude_list_of_fields(cls, course_key): exclude_list.append('social_sharing_url') # Do not show teams configuration if feature is disabled. - if not settings.FEATURES.get('ENABLE_TEAMS'): + if not settings.ENABLE_TEAMS: exclude_list.append('teams_configuration') - if not settings.FEATURES.get('ENABLE_VIDEO_BUMPER'): + if not settings.ENABLE_VIDEO_BUMPER: exclude_list.append('video_bumper') # Do not show enable_ccx if feature is not enabled. - if not settings.FEATURES.get('CUSTOM_COURSES_EDX'): + if not settings.CUSTOM_COURSES_EDX: exclude_list.append('enable_ccx') exclude_list.append('ccx_connector') diff --git a/cms/envs/common.py b/cms/envs/common.py index f4f6fd8b9c9d..b88375a17372 100644 --- a/cms/envs/common.py +++ b/cms/envs/common.py @@ -82,10 +82,6 @@ # Segment - must explicitly turn it on for production CMS_SEGMENT_KEY = None -# If set to True, new Studio users won't be able to author courses unless -# an Open edX admin has added them to the course creator group. -ENABLE_CREATOR_GROUP = True - # If set to True, organization staff members can create libraries for their specific # organization and no other organizations. They do not need to be course creators, # even when ENABLE_CREATOR_GROUP is True. @@ -120,19 +116,6 @@ # course and that can be read from themes ENABLE_OTHER_COURSE_SETTINGS = False -# Enable support for content libraries. Note that content libraries are -# only supported in courses using split mongo. -ENABLE_CONTENT_LIBRARIES = True - -# .. toggle_name: settings.ENABLE_CONTENT_LIBRARIES_LTI_TOOL -# .. toggle_implementation: DjangoSetting -# .. toggle_default: False -# .. toggle_description: When set to True, Content Libraries in -# Studio can be used as an LTI 1.3 tool by external LTI platforms. -# .. toggle_use_cases: open_edx -# .. toggle_creation_date: 2021-08-17 -# .. toggle_tickets: https://github.com/openedx/edx-platform/pull/27411 -ENABLE_CONTENT_LIBRARIES_LTI_TOOL = False # Toggle course entrance exams feature ENTRANCE_EXAMS = False @@ -238,14 +221,6 @@ # .. toggle_tickets: https://github.com/openedx/edx-platform/pull/33952 ENABLE_HIDE_FROM_TOC_UI = False -# .. toggle_name: settings.IN_CONTEXT_DISCUSSION_ENABLED_DEFAULT -# .. toggle_implementation: DjangoSetting -# .. toggle_default: True -# .. toggle_description: Set to False to disable in-context discussion for units by default. -# .. toggle_use_cases: open_edx -# .. toggle_creation_date: 2024-09-02 -IN_CONTEXT_DISCUSSION_ENABLED_DEFAULT = True - # .. toggle_name: ENABLE_COPPA_COMPLIANCE # .. toggle_implementation: DjangoSetting # .. toggle_default: False diff --git a/cms/templates/howitworks.html b/cms/templates/howitworks.html index d21dff2d66a5..e12671bca16b 100644 --- a/cms/templates/howitworks.html +++ b/cms/templates/howitworks.html @@ -154,7 +154,7 @@
${_('Access to this component is not restricted, but visibility might be affected by inherited settings.')}
%endif - % if settings.FEATURES.get('ENABLE_ENROLLMENT_TRACK_USER_PARTITION'): + % if settings.ENABLE_ENROLLMENT_TRACK_USER_PARTITION: % if block_is_unit:${_('You can restrict access to this unit to learners in specific enrollment tracks or content groups.')}
% else: diff --git a/cms/templates/widgets/deprecated-course-key-warning.html b/cms/templates/widgets/deprecated-course-key-warning.html index 33de5e8d6465..3db76a2fc84a 100644 --- a/cms/templates/widgets/deprecated-course-key-warning.html +++ b/cms/templates/widgets/deprecated-course-key-warning.html @@ -9,7 +9,7 @@ from openedx.core.djangolib.translation_utils import translate_date DEFAULT_LANGUAGE = getattr(settings, 'LANGUAGE_CODE', 'en') -IS_ENABLED = settings.FEATURES.get('DEPRECATE_OLD_COURSE_KEYS_IN_STUDIO', True) +IS_ENABLED = settings.DEPRECATE_OLD_COURSE_KEYS_IN_STUDIO %> <% is_visible = IS_ENABLED and course and course.id.deprecated diff --git a/cms/templates/widgets/header.html b/cms/templates/widgets/header.html index 4a8c7a142a86..6b3fb2ca46fb 100644 --- a/cms/templates/widgets/header.html +++ b/cms/templates/widgets/header.html @@ -42,7 +42,7 @@