plugins.py 786 Bytes
Newer Older
Diana Huang committed
1 2 3
"""
Definition of the course team feature.
"""
4
from django.utils.translation import ugettext_noop
5
from courseware.tabs import EnrolledTab
6
from . import is_feature_enabled
Diana Huang committed
7 8


9
class TeamsTab(EnrolledTab):
Diana Huang committed
10 11 12 13
    """
    The representation of the course teams view type.
    """

14
    type = "teams"
15
    title = ugettext_noop("Teams")
Diana Huang committed
16 17 18 19 20 21 22 23 24 25
    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
        """
26
        if not super(TeamsTab, cls).is_enabled(course, user=user):
Diana Huang committed
27 28 29
            return False

        return is_feature_enabled(course)