Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
750 changes: 374 additions & 376 deletions cms/envs/common.py

Large diffs are not rendered by default.

28 changes: 14 additions & 14 deletions cms/envs/devstack.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@

################################## Video Pipeline Settings #########################

FEATURES['ENABLE_VIDEO_UPLOAD_PIPELINE'] = True
ENABLE_VIDEO_UPLOAD_PIPELINE = True

########################### PIPELINE #################################

Expand Down Expand Up @@ -126,7 +126,7 @@ def should_show_debug_toolbar(request): # lint-amnesty, pylint: disable=missing


################################ MILESTONES ################################
FEATURES['MILESTONES_APP'] = True
MILESTONES_APP = True

########################### ORGANIZATIONS #################################
# Although production studio.edx.org disables `ORGANIZATIONS_AUTOCREATE`,
Expand All @@ -136,16 +136,16 @@ def should_show_debug_toolbar(request): # lint-amnesty, pylint: disable=missing
ORGANIZATIONS_AUTOCREATE = True

################################ ENTRANCE EXAMS ################################
FEATURES['ENTRANCE_EXAMS'] = True
ENTRANCE_EXAMS = True

################################ COURSE LICENSES ################################
FEATURES['LICENSING'] = True
LICENSING = True
# Needed to enable licensing on video blocks
XBLOCK_SETTINGS.update({'VideoBlock': {'licensing_enabled': True}})

################################ SEARCH INDEX ################################
FEATURES['ENABLE_COURSEWARE_INDEX'] = True
FEATURES['ENABLE_LIBRARY_INDEX'] = False
ENABLE_COURSEWARE_INDEX = True
ENABLE_LIBRARY_INDEX = False
SEARCH_ENGINE = "search.elastic.ElasticSearchEngine"

ELASTIC_SEARCH_CONFIG = [
Expand All @@ -157,22 +157,22 @@ def should_show_debug_toolbar(request): # lint-amnesty, pylint: disable=missing
]

################################ COURSE DISCUSSIONS ###########################
FEATURES['ENABLE_DISCUSSION_SERVICE'] = True
ENABLE_DISCUSSION_SERVICE = True

################################ CREDENTIALS ###########################
CREDENTIALS_SERVICE_USERNAME = 'credentials_worker'

########################## Certificates Web/HTML View #######################
FEATURES['CERTIFICATES_HTML_VIEW'] = True
CERTIFICATES_HTML_VIEW = True

########################## AUTHOR PERMISSION #######################
FEATURES['ENABLE_CREATOR_GROUP'] = True
ENABLE_CREATOR_GROUP = True

########################## Library creation organizations restriction #######################
FEATURES['ENABLE_ORGANIZATION_STAFF_ACCESS_FOR_CONTENT_LIBRARIES'] = True
ENABLE_ORGANIZATION_STAFF_ACCESS_FOR_CONTENT_LIBRARIES = True

################### FRONTEND APPLICATION PUBLISHER URL ###################
FEATURES['FRONTEND_APP_PUBLISHER_URL'] = 'http://localhost:18400'
FRONTEND_APP_PUBLISHER_URL = 'http://localhost:18400'

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

############# CORS headers for cross-domain requests #################
FEATURES['ENABLE_CORS_HEADERS'] = True
ENABLE_CORS_HEADERS = True
CORS_ALLOW_CREDENTIALS = True
CORS_ORIGIN_ALLOW_ALL = True

################### Special Exams (Proctoring) and Prereqs ###################
FEATURES['ENABLE_SPECIAL_EXAMS'] = True
FEATURES['ENABLE_PREREQUISITE_COURSES'] = True
ENABLE_SPECIAL_EXAMS = True
ENABLE_PREREQUISITE_COURSES = True

# Used in edx-proctoring for ID generation in lieu of SECRET_KEY - dummy value
# (ref MST-637)
Expand Down
11 changes: 8 additions & 3 deletions cms/envs/production.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,11 @@
from openedx.core.lib.logsettings import get_logger_config # lint-amnesty, pylint: disable=wrong-import-order
from xmodule.modulestore.modulestore_settings import convert_module_store_setting_if_needed # lint-amnesty, pylint: disable=wrong-import-order

from openedx.core.lib.features_setting_proxy import FeaturesProxy

# A proxy for feature flags stored in the settings namespace
FEATURES = FeaturesProxy(globals())


def get_env_setting(setting):
""" Get the environment setting or return exception """
Expand Down Expand Up @@ -286,7 +291,7 @@ def get_env_setting(setting):
)


if FEATURES['ENABLE_COURSEWARE_INDEX'] or FEATURES['ENABLE_LIBRARY_INDEX']:
if ENABLE_COURSEWARE_INDEX or ENABLE_LIBRARY_INDEX:
# Use ElasticSearch for the search engine
SEARCH_ENGINE = "search.elastic.ElasticSearchEngine"

Expand All @@ -302,7 +307,7 @@ def get_env_setting(setting):
JWT_AUTH.update(_YAML_TOKENS.get('JWT_AUTH', {}))

######################## CUSTOM COURSES for EDX CONNECTOR ######################
if FEATURES['CUSTOM_COURSES_EDX']:
if CUSTOM_COURSES_EDX:
INSTALLED_APPS.append('openedx.core.djangoapps.ccxcon.apps.CCXConnectorConfig')

########################## Extra middleware classes #######################
Expand Down Expand Up @@ -347,7 +352,7 @@ def get_env_setting(setting):
####

############# CORS headers for cross-domain requests #################
if FEATURES['ENABLE_CORS_HEADERS']:
if ENABLE_CORS_HEADERS:
CORS_ALLOW_CREDENTIALS = True
CORS_ORIGIN_WHITELIST = _YAML_TOKENS.get('CORS_ORIGIN_WHITELIST', ())
CORS_ORIGIN_ALLOW_ALL = _YAML_TOKENS.get('CORS_ORIGIN_ALLOW_ALL', False)
Expand Down
37 changes: 20 additions & 17 deletions cms/envs/test.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@

from xmodule.modulestore.modulestore_settings import update_module_store_settings # pylint: disable=wrong-import-order

from openedx.core.lib.features_setting_proxy import FeaturesProxy

from .common import *

# import settings from LMS for consistent behavior with CMS
Expand All @@ -46,6 +48,8 @@
XBLOCK_RUNTIME_V2_EPHEMERAL_DATA_CACHE,
)

# A proxy for feature flags stored in the settings namespace
FEATURES = FeaturesProxy(globals())

# Include a non-ascii character in STUDIO_NAME and STUDIO_SHORT_NAME to uncover possible
# UnicodeEncodeErrors in tests. Also use lazy text to reveal possible json dumps errors
Expand All @@ -72,7 +76,7 @@
COMMON_TEST_DATA_ROOT = COMMON_ROOT / "test" / "data"

# For testing "push to lms"
FEATURES["ENABLE_EXPORT_GIT"] = True
ENABLE_EXPORT_GIT = True
GIT_REPO_EXPORT_DIR = TEST_ROOT / "export_course_repos"

# TODO (cpennington): We need to figure out how envs/test.py can inject things into common.py so that we don't have to repeat this sort of thing # lint-amnesty, pylint: disable=line-too-long
Expand Down Expand Up @@ -203,51 +207,50 @@
# No segment key
CMS_SEGMENT_KEY = None

FEATURES["DISABLE_SET_JWT_COOKIES_FOR_TESTS"] = True
DISABLE_SET_JWT_COOKIES_FOR_TESTS = True

FEATURES["ENABLE_SERVICE_STATUS"] = True
ENABLE_SERVICE_STATUS = True

# Toggles embargo on for testing
FEATURES["EMBARGO"] = True
EMBARGO = True

TEST_THEME = COMMON_ROOT / "test" / "test-theme"

# For consistency in user-experience, keep the value of this setting in sync with
# the one in lms/envs/test.py
FEATURES["ENABLE_DISCUSSION_SERVICE"] = False
ENABLE_DISCUSSION_SERVICE = False

# Enable a parental consent age limit for testing
PARENTAL_CONSENT_AGE_LIMIT = 13

# Enable certificates for the tests
FEATURES["CERTIFICATES_HTML_VIEW"] = True
CERTIFICATES_HTML_VIEW = True

# Enable content libraries code for the tests
FEATURES["ENABLE_CONTENT_LIBRARIES"] = True
ENABLE_CONTENT_LIBRARIES = True

FEATURES["ENABLE_EDXNOTES"] = True
ENABLE_EDXNOTES = True

# MILESTONES
FEATURES["MILESTONES_APP"] = True
MILESTONES_APP = True

# ENTRANCE EXAMS
FEATURES["ENTRANCE_EXAMS"] = True
ENTRANCE_EXAM_MIN_SCORE_PCT = 50
ENTRANCE_EXAMS = True

VIDEO_CDN_URL = {"CN": "http://api.xuetangx.com/edx/video?s3_url="}

# Courseware Search Index
FEATURES["ENABLE_COURSEWARE_INDEX"] = True
FEATURES["ENABLE_LIBRARY_INDEX"] = True
ENABLE_COURSEWARE_INDEX = True
ENABLE_LIBRARY_INDEX = True
SEARCH_ENGINE = "search.tests.mock_search_engine.MockSearchEngine"

FEATURES["ENABLE_ENROLLMENT_TRACK_USER_PARTITION"] = True
ENABLE_ENROLLMENT_TRACK_USER_PARTITION = True

########################## AUTHOR PERMISSION #######################
FEATURES["ENABLE_CREATOR_GROUP"] = False
ENABLE_CREATOR_GROUP = False

# teams feature
FEATURES["ENABLE_TEAMS"] = True
ENABLE_TEAMS = True

# Dummy secret key for dev/test
SECRET_KEY = "85920908f28904ed733fe576320db18cabd7b6cd"
Expand All @@ -257,7 +260,7 @@
"openedx.core.djangoapps.ccxcon.apps.CCXConnectorConfig",
"common.djangoapps.third_party_auth.apps.ThirdPartyAuthConfig",
]
FEATURES["CUSTOM_COURSES_EDX"] = True
CUSTOM_COURSES_EDX = True

########################## VIDEO IMAGE STORAGE ############################
VIDEO_IMAGE_SETTINGS = dict(
Expand Down
2 changes: 1 addition & 1 deletion lms/djangoapps/discussion/settings/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ def plugin_settings(settings):
# .. toggle_use_cases: open_edx
# .. toggle_creation_date: 2015-06-15
# .. toggle_tickets: https://github.com/openedx/edx-platform/pull/8474
settings.FEATURES['ALLOW_HIDING_DISCUSSION_TAB'] = False
settings.ALLOW_HIDING_DISCUSSION_TAB = False
settings.DISCUSSION_SETTINGS = {
'MAX_COMMENT_DEPTH': 2,
'COURSE_PUBLISH_TASK_DELAY': 30,
Expand Down
Loading
Loading