Silence DeprecatedEdxPlatformImportWarning by default

This commit is contained in:
Kyle McCormick
2020-10-27 16:23:46 -04:00
committed by Kyle McCormick
parent 090e10683c
commit 630d30563a
2 changed files with 19 additions and 0 deletions

View File

@@ -43,6 +43,8 @@ When refering to XBlocks, we use the entry-point name. For example,
import importlib.util
import os
import sys
import warnings
from corsheaders.defaults import default_headers as corsheaders_default_headers
from datetime import timedelta
import lms.envs.common
@@ -115,6 +117,7 @@ from lms.envs.common import (
from path import Path as path
from django.urls import reverse_lazy
from import_shims.warn import DeprecatedEdxPlatformImportWarning
from lms.djangoapps.lms_xblock.mixin import LmsBlockMixin
from cms.lib.xblock.authoring_mixin import AuthoringMixin
from xmodule.modulestore.edit_info import EditInfoMixin
@@ -128,6 +131,13 @@ from openedx.core.release import doc_version
# pylint: enable=useless-suppression
# Filter out DeprecatedEdxPlatformImportWarning instances for now.
# We will want these to be generally visible eventually, but while there
# are still a very high number of them, silencing them will be better for
# developer experience.
# See /docs/decisions/0007-sys-path-modification-removal.rst for details.
warnings.filterwarnings("ignore", category=DeprecatedEdxPlatformImportWarning)
################ Enable credit eligibility feature ####################
ENABLE_CREDIT_ELIGIBILITY = True

View File

@@ -32,6 +32,7 @@ Longer TODO:
import importlib.util
import sys
import os
import warnings
from corsheaders.defaults import default_headers as corsheaders_default_headers
from path import Path as path
@@ -45,6 +46,7 @@ from enterprise.constants import (
ENTERPRISE_OPERATOR_ROLE
)
from import_shims.warn import DeprecatedEdxPlatformImportWarning
from openedx.core.constants import COURSE_KEY_REGEX, COURSE_KEY_PATTERN, COURSE_ID_PATTERN
from openedx.core.djangoapps.theming.helpers_dirs import (
get_themes_unchecked,
@@ -54,6 +56,13 @@ from openedx.core.lib.derived import derived, derived_collection_entry
from openedx.core.release import doc_version
from lms.djangoapps.lms_xblock.mixin import LmsBlockMixin
# Filter out DeprecatedEdxPlatformImportWarning instances for now.
# We will want these to be generally visible eventually, but while there
# are still a very high number of them, silencing them will be better for
# developer experience.
# See /docs/decisions/0007-sys-path-modification-removal.rst for details.
warnings.filterwarnings("ignore", category=DeprecatedEdxPlatformImportWarning)
################################### FEATURES ###################################
# .. setting_name: PLATFORM_NAME
# .. setting_default: Your Platform Name Here