Don't add the ContentGatingPartition to group_access in content_type_gating.field_overrides if the waffle flag is off
This commit is contained in:
@@ -6,6 +6,9 @@ from django.conf import settings
|
|||||||
|
|
||||||
from lms.djangoapps.courseware.field_overrides import FieldOverrideProvider, disable_overrides
|
from lms.djangoapps.courseware.field_overrides import FieldOverrideProvider, disable_overrides
|
||||||
from openedx.features.content_type_gating.partitions import CONTENT_GATING_PARTITION_ID
|
from openedx.features.content_type_gating.partitions import CONTENT_GATING_PARTITION_ID
|
||||||
|
from openedx.features.course_duration_limits.config import (
|
||||||
|
CONTENT_TYPE_GATING_FLAG,
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
class ContentTypeGatingFieldOverride(FieldOverrideProvider):
|
class ContentTypeGatingFieldOverride(FieldOverrideProvider):
|
||||||
@@ -15,6 +18,9 @@ class ContentTypeGatingFieldOverride(FieldOverrideProvider):
|
|||||||
graded content to only be accessible to the Full Access group
|
graded content to only be accessible to the Full Access group
|
||||||
"""
|
"""
|
||||||
def get(self, block, name, default):
|
def get(self, block, name, default):
|
||||||
|
if not CONTENT_TYPE_GATING_FLAG.is_enabled():
|
||||||
|
return default
|
||||||
|
|
||||||
if name != 'group_access':
|
if name != 'group_access':
|
||||||
return default
|
return default
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user