本文整理汇总了Python中util.milestones_helpers.is_prerequisite_courses_enabled函数的典型用法代码示例。如果您正苦于以下问题:Python is_prerequisite_courses_enabled函数的具体用法?Python is_prerequisite_courses_enabled怎么用?Python is_prerequisite_courses_enabled使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了is_prerequisite_courses_enabled函数的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Python代码示例。
示例1: handle_post_cert_generated
def handle_post_cert_generated(sender, instance, **kwargs): # pylint: disable=unused-argument
"""
Handles post_save signal of GeneratedCertificate, and mark user collected
course milestone entry if user has passed the course.
User is assumed to have passed the course if certificate status is either 'generating' or 'downloadable'.
"""
allowed_cert_states = [CertificateStatuses.generating, CertificateStatuses.downloadable]
if is_prerequisite_courses_enabled() and instance.status in allowed_cert_states:
fulfill_course_milestone(instance.course_id, instance.user)
开发者ID:msaqib52,项目名称:edx-platform,代码行数:9,代码来源:models.py
示例2: test_pre_requisite_courses_enabled
def test_pre_requisite_courses_enabled(self, feature_flags):
"""
Tests is_prerequisite_courses_enabled function with a set of possible values for
ENABLE_PREREQUISITE_COURSES and MILESTONES_APP feature flags.
"""
with patch.dict("django.conf.settings.FEATURES", {
'ENABLE_PREREQUISITE_COURSES': feature_flags[0],
'MILESTONES_APP': feature_flags[1]
}):
self.assertEqual(feature_flags[2], milestones_helpers.is_prerequisite_courses_enabled())
开发者ID:Lektorium-LLC,项目名称:edx-platform,代码行数:11,代码来源:test_milestones_helpers.py
示例3: _is_prerequisites_disabled
def _is_prerequisites_disabled():
"""
Checks if prerequisites are disabled in the settings.
"""
return ACCESS_DENIED if is_prerequisite_courses_enabled() else ACCESS_GRANTED
开发者ID:AlexxNica,项目名称:edx-platform,代码行数:5,代码来源:access.py
示例4: handle_course_cert_awarded
def handle_course_cert_awarded(sender, user, course_key, **kwargs): # pylint: disable=unused-argument
"""
Mark a milestone entry if user has passed the course.
"""
if is_prerequisite_courses_enabled():
fulfill_course_milestone(course_key, user)
开发者ID:Lektorium-LLC,项目名称:edx-platform,代码行数:6,代码来源:models.py
注:本文中的util.milestones_helpers.is_prerequisite_courses_enabled函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论