Enable self-paced courses behind a feature flag.

This commit is contained in:
Peter Fogg
2015-10-07 15:28:47 -04:00
parent 9d88bef117
commit 0107525d41
7 changed files with 25 additions and 3 deletions

View File

@@ -54,7 +54,8 @@ class CourseDetails(object):
'50'
) # minimum passing score for entrance exam content module/tree,
self.has_cert_config = None # course has active certificate configuration
self.self_paced = None
if settings.FEATURES.get('ENABLE_SELF_PACED_COURSES'):
self.self_paced = None
@classmethod
def _fetch_about_attribute(cls, course_key, attribute):
@@ -87,7 +88,8 @@ class CourseDetails(object):
# Default course license is "All Rights Reserved"
course_details.license = getattr(descriptor, "license", "all-rights-reserved")
course_details.has_cert_config = has_active_web_certificate(descriptor)
course_details.self_paced = descriptor.self_paced
if settings.FEATURES.get('ENABLE_SELF_PACED_COURSES'):
course_details.self_paced = descriptor.self_paced
for attribute in ABOUT_ATTRIBUTES:
value = cls._fetch_about_attribute(course_key, attribute)
@@ -190,7 +192,9 @@ class CourseDetails(object):
descriptor.language = jsondict['language']
dirty = True
if 'self_paced' in jsondict and jsondict['self_paced'] != descriptor.self_paced:
if (settings.FEATURES.get('ENABLE_SELF_PACED_COURSES')
and 'self_paced' in jsondict
and jsondict['self_paced'] != descriptor.self_paced):
descriptor.self_paced = jsondict['self_paced']
dirty = True