def is_discussion_enabled(course_id): """ Return True if Discussion is enabled for a course; else False """ if settings.FEATURES.get('CUSTOM_COURSES_EDX', False): if get_current_ccx(course_id): return False return settings.FEATURES.get('ENABLE_DISCUSSION_SERVICE')
def is_enabled(cls, course, user=None): if not super(DiscussionTab, cls).is_enabled(course, user): return False if settings.FEATURES.get('CUSTOM_COURSES_EDX', False): if get_current_ccx(course.id): return False return settings.FEATURES.get('ENABLE_DISCUSSION_SERVICE')
def can_display(self, course, settings, is_user_authenticated, is_user_staff, is_user_enrolled): if settings.FEATURES.get('CUSTOM_COURSES_EDX', False): from ccx.overrides import get_current_ccx # pylint: disable=import-error if get_current_ccx(): return False super_can_display = super(DiscussionTab, self).can_display(course, settings, is_user_authenticated, is_user_staff, is_user_enrolled) return settings.FEATURES.get( 'ENABLE_DISCUSSION_SERVICE') and super_can_display