MIT CCX: Prevent the discussion tab from displaying

When the POC feature is enabled and there is an active poc displaying discussions leads to undefined behaviors.  Hide the tab to prevent usability problems.
This commit is contained in:
cewing
2015-01-16 14:26:47 -08:00
parent 97748e56ea
commit fbaab9674f

View File

@@ -376,6 +376,10 @@ class DiscussionTab(EnrolledOrStaffTab):
)
def can_display(self, course, settings, is_user_authenticated, is_user_staff, is_user_enrolled):
if settings.FEATURES.get('PERSONAL_ONLINE_COURSES', False):
from pocs.overrides import get_current_poc
if get_current_poc():
return False
super_can_display = super(DiscussionTab, self).can_display(
course, settings, is_user_authenticated, is_user_staff, is_user_enrolled
)