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:
Calen Pennington
2018-11-01 15:20:15 -04:00
parent b14d9b4813
commit 76859f04a8

View File

@@ -6,6 +6,9 @@ from django.conf import settings
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.course_duration_limits.config import (
CONTENT_TYPE_GATING_FLAG,
)
class ContentTypeGatingFieldOverride(FieldOverrideProvider):
@@ -15,6 +18,9 @@ class ContentTypeGatingFieldOverride(FieldOverrideProvider):
graded content to only be accessible to the Full Access group
"""
def get(self, block, name, default):
if not CONTENT_TYPE_GATING_FLAG.is_enabled():
return default
if name != 'group_access':
return default