REVE-154 FBE Global Kill Switch
Create a global kill switch for feature based enrollment. To turn on the kill switch (and turn off both course duration gating and content type gating) enable a waffle flag named: 'content_type_gating.global_kill_switch'
This commit is contained in:
@@ -17,7 +17,10 @@ from django_comment_common.models import assign_default_role
|
||||
from django_comment_common.utils import seed_permissions_roles
|
||||
from openedx.core.djangoapps.site_configuration.models import SiteConfiguration
|
||||
from openedx.features.content_type_gating.models import ContentTypeGatingConfig
|
||||
from openedx.features.course_duration_limits.config import CONTENT_TYPE_GATING_FLAG
|
||||
from openedx.features.course_duration_limits.config import (
|
||||
CONTENT_TYPE_GATING_FLAG,
|
||||
FEATURE_BASED_ENROLLMENT_GLOBAL_KILL_FLAG
|
||||
)
|
||||
from student import auth
|
||||
from student.models import CourseEnrollment
|
||||
from student.roles import CourseInstructorRole, CourseStaffRole
|
||||
@@ -460,7 +463,7 @@ def get_visibility_partition_info(xblock, course=None):
|
||||
if len(partition["groups"]) > 1 or any(group["selected"] for group in partition["groups"]):
|
||||
selectable_partitions.append(partition)
|
||||
|
||||
flag_enabled = CONTENT_TYPE_GATING_FLAG.is_enabled()
|
||||
flag_enabled = CONTENT_TYPE_GATING_FLAG.is_enabled() and not FEATURE_BASED_ENROLLMENT_GLOBAL_KILL_FLAG.is_enabled()
|
||||
course_key = xblock.scope_ids.usage_id.course_key
|
||||
is_library = isinstance(course_key, LibraryLocator)
|
||||
if not is_library and (
|
||||
|
||||
Reference in New Issue
Block a user