* For all files, from __future__ import unicode_literals. * Add @python_2_unicode_compatible to both models. * Test six.string_type(obj) for both models. Also, fix some new pylint warnings and improve model repr methods. MST-24
34 lines
861 B
Python
34 lines
861 B
Python
"""
|
|
Definition of the course team feature.
|
|
"""
|
|
from __future__ import absolute_import, unicode_literals
|
|
|
|
from django.utils.translation import ugettext_noop
|
|
|
|
from lms.djangoapps.courseware.tabs import EnrolledTab
|
|
|
|
from . import is_feature_enabled
|
|
|
|
|
|
class TeamsTab(EnrolledTab):
|
|
"""
|
|
The representation of the course teams view type.
|
|
"""
|
|
|
|
type = "teams"
|
|
title = ugettext_noop("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(TeamsTab, cls).is_enabled(course, user=user):
|
|
return False
|
|
|
|
return is_feature_enabled(course)
|