diff --git a/cms/envs/production.py b/cms/envs/production.py index 604d2753bccd..60d5f88c1b59 100644 --- a/cms/envs/production.py +++ b/cms/envs/production.py @@ -287,7 +287,7 @@ def get_env_setting(setting): # TODO: Once we have successfully upgraded to ES7, switch this back to ELASTIC_SEARCH_CONFIG. ELASTIC_SEARCH_CONFIG = _YAML_TOKENS.get('ELASTIC_SEARCH_CONFIG_ES7', [{}]) -XBLOCK_SETTINGS.setdefault("VideoBlock", {})["licensing_enabled"] = FEATURES["LICENSING"] # noqa: F405 +XBLOCK_SETTINGS.setdefault("VideoBlock", {})["licensing_enabled"] = LICENSING # noqa: F405 XBLOCK_SETTINGS.setdefault("VideoBlock", {})['YOUTUBE_API_KEY'] = YOUTUBE_API_KEY # noqa: F405 ############################ OAUTH2 Provider ################################### diff --git a/lms/envs/production.py b/lms/envs/production.py index b13f232f5bb7..035f282dbd6f 100644 --- a/lms/envs/production.py +++ b/lms/envs/production.py @@ -332,7 +332,7 @@ def get_env_setting(setting): # TODO: Once we have successfully upgraded to ES7, switch this back to ELASTIC_SEARCH_CONFIG. ELASTIC_SEARCH_CONFIG = _YAML_TOKENS.get('ELASTIC_SEARCH_CONFIG_ES7', [{}]) -XBLOCK_SETTINGS.setdefault("VideoBlock", {})["licensing_enabled"] = FEATURES["LICENSING"] # noqa: F405 +XBLOCK_SETTINGS.setdefault("VideoBlock", {})["licensing_enabled"] = LICENSING # noqa: F405 XBLOCK_SETTINGS.setdefault("VideoBlock", {})['YOUTUBE_API_KEY'] = YOUTUBE_API_KEY # noqa: F405 ##### Custom Courses for EdX ##### diff --git a/openedx/envs/common.py b/openedx/envs/common.py index e4326a9fa81d..bf18e1f901a8 100644 --- a/openedx/envs/common.py +++ b/openedx/envs/common.py @@ -1213,6 +1213,17 @@ def add_optional_apps(optional_apps, installed_apps): # .. toggle_tickets: https://github.com/openedx/edx-platform/pull/9744 ENABLE_SPECIAL_EXAMS = False +# .. toggle_name: ENABLE_EXAM_SETTINGS_HTML_VIEW +# .. toggle_implementation: DjangoSetting +# .. toggle_default: False +# .. toggle_description: Enable the "Exam Settings" view in Studio's course settings. When enabled, +# the corresponding legacy proctored/timed-exam fields on the course are marked deprecated in the +# advanced settings editor so they are edited via the dedicated view instead. +# .. toggle_use_cases: open_edx +# .. toggle_creation_date: 2020-07-09 +# .. toggle_tickets: https://github.com/openedx/edx-platform/pull/24405 +ENABLE_EXAM_SETTINGS_HTML_VIEW = False + # .. toggle_name: SHOW_HEADER_LANGUAGE_SELECTOR # .. toggle_implementation: DjangoSetting # .. toggle_default: False diff --git a/xmodule/course_block.py b/xmodule/course_block.py index eee5beab8a66..3af54d8bde9b 100644 --- a/xmodule/course_block.py +++ b/xmodule/course_block.py @@ -45,16 +45,11 @@ CATALOG_VISIBILITY_ABOUT = "about" CATALOG_VISIBILITY_NONE = "none" -DEFAULT_COURSE_VISIBILITY_IN_CATALOG = getattr( - settings, - 'DEFAULT_COURSE_VISIBILITY_IN_CATALOG', - 'both' -) +DEFAULT_COURSE_VISIBILITY_IN_CATALOG = settings.DEFAULT_COURSE_VISIBILITY_IN_CATALOG -DEFAULT_MOBILE_AVAILABLE = getattr(settings, 'DEFAULT_MOBILE_AVAILABLE', False) -# Note: updating assets does not have settings defined, so using `getattr`. -EXAM_SETTINGS_HTML_VIEW_ENABLED = getattr(settings, 'FEATURES', {}).get('ENABLE_EXAM_SETTINGS_HTML_VIEW', False) -SPECIAL_EXAMS_ENABLED = getattr(settings, 'ENABLE_SPECIAL_EXAMS', False) +DEFAULT_MOBILE_AVAILABLE = settings.DEFAULT_MOBILE_AVAILABLE +EXAM_SETTINGS_HTML_VIEW_ENABLED = settings.ENABLE_EXAM_SETTINGS_HTML_VIEW +SPECIAL_EXAMS_ENABLED = settings.ENABLE_SPECIAL_EXAMS COURSE_VISIBILITY_PRIVATE = 'private' COURSE_VISIBILITY_PUBLIC_OUTLINE = 'public_outline' @@ -236,7 +231,7 @@ def from_json(self, value, validate_providers=False): and include any inherited values from the platform default. """ value = super().from_json(value) - if getattr(settings, 'ENABLE_PROCTORED_EXAMS', False): + if settings.ENABLE_PROCTORED_EXAMS: # Only validate the provider value if ProctoredExams are enabled on the environment # Otherwise, the passed in provider does not matter. We should always return default if validate_providers: @@ -275,7 +270,7 @@ def default(self): """ default = super().default - proctoring_backend_settings = getattr(settings, 'PROCTORING_BACKENDS', None) + proctoring_backend_settings = settings.PROCTORING_BACKENDS if proctoring_backend_settings: return proctoring_backend_settings.get('DEFAULT', None) @@ -287,11 +282,7 @@ def get_available_providers() -> list[str]: """ Return list of available proctoring providers. """ - proctoring_backend_settings = getattr( - settings, - 'PROCTORING_BACKENDS', - {} - ) + proctoring_backend_settings = settings.PROCTORING_BACKENDS available_providers = [provider for provider in proctoring_backend_settings if provider != 'DEFAULT'] available_providers.append('lti_external')