From 52f56ddd37d5adec3b1fa1aecf8315c7cfd9742a Mon Sep 17 00:00:00 2001
From: Sven Marnach <sven@marnach.net>
Date: Thu, 11 Jun 2015 12:09:46 +0200
Subject: [PATCH] Add feature flag to allow hiding the discussion tab for
 individual courses.

---
 cms/envs/common.py                                  | 3 +++
 lms/djangoapps/django_comment_client/forum/views.py | 1 +
 2 files changed, 4 insertions(+)

diff --git a/cms/envs/common.py b/cms/envs/common.py
index bb47f87384d..f559f0f4f33 100644
--- a/cms/envs/common.py
+++ b/cms/envs/common.py
@@ -175,6 +175,9 @@ FEATURES = {
 
     # Enable credit eligibility feature
     'ENABLE_CREDIT_ELIGIBILITY': False,
+
+    # Can the visibility of the discussion tab be configured on a per-course basis?
+    'ALLOW_HIDING_DISCUSSION_TAB': False,
 }
 
 ENABLE_JASMINE = False
diff --git a/lms/djangoapps/django_comment_client/forum/views.py b/lms/djangoapps/django_comment_client/forum/views.py
index 1aa4df0ac38..d415b682bf0 100644
--- a/lms/djangoapps/django_comment_client/forum/views.py
+++ b/lms/djangoapps/django_comment_client/forum/views.py
@@ -58,6 +58,7 @@ class DiscussionTab(EnrolledTab):
     title = _('Discussion')
     priority = None
     view_name = 'django_comment_client.forum.views.forum_form_discussion'
+    is_hideable = settings.FEATURES.get('ALLOW_HIDING_DISCUSSION_TAB', False)
 
     @classmethod
     def is_enabled(cls, course, user=None):
-- 
GitLab