Files
edx-platform/lms/djangoapps/teams/plugins.py
Diana Huang 6534503c93 Add teams tab
TNL-1939
2015-06-03 09:10:44 -04:00

31 lines
824 B
Python

"""
Definition of the course team feature.
"""
from django.utils.translation import ugettext as _
from courseware.tabs import EnrolledCourseViewType
from .views import is_feature_enabled
class TeamsCourseViewType(EnrolledCourseViewType):
"""
The representation of the course teams view type.
"""
name = "teams"
title = _("Teams")
view_name = "teams_dashboard"
@classmethod
def is_enabled(cls, course, user=None):
"""Returns true if the teams feature is enabled in the course.
Args:
course (CourseDescriptor): the course using the feature
user (User): the user interacting with the course
"""
if not super(TeamsCourseViewType, cls).is_enabled(course, user=user):
return False
return is_feature_enabled(course)