refactor: move waffle flag calculation to utils file and other updates

This commit is contained in:
SaadYousaf
2021-06-21 22:08:49 +05:00
parent 90921e19e2
commit 608f1994b7
6 changed files with 30 additions and 16 deletions

View File

@@ -14,8 +14,7 @@ from xblock.fields import Scope
from cms.djangoapps.contentstore import toggles
from common.djangoapps.xblock_django.models import XBlockStudioConfigurationFlag
from openedx.core.djangoapps.discussions.config.waffle import OVERRIDE_DISCUSSION_LEGACY_SETTINGS_FLAG, \
ENABLE_PAGES_AND_RESOURCES_MICROFRONTEND
from openedx.core.djangoapps.discussions.config.waffle_utils import legacy_discussion_experience_enabled
from openedx.core.lib.teams_config import TeamsetType
from openedx.features.course_experience import COURSE_ENABLE_UNENROLLED_ACCESS_FLAG
from xmodule.modulestore.django import modulestore
@@ -143,8 +142,7 @@ class CourseMetadata:
if not settings.PROCTORING_BACKENDS or settings.PROCTORING_BACKENDS.get('proctortrack') is None:
exclude_list.append('proctoring_escalation_email')
if (ENABLE_PAGES_AND_RESOURCES_MICROFRONTEND.is_enabled(course_key) and
not OVERRIDE_DISCUSSION_LEGACY_SETTINGS_FLAG.is_enabled(course_key)):
if not legacy_discussion_experience_enabled(course_key):
exclude_list.append('discussion_blackouts')
exclude_list.append('allow_anonymous')
exclude_list.append('allow_anonymous_to_peers')