From 8be8ac8fbf77ba89f95d0273d0ae11a053ec94d6 Mon Sep 17 00:00:00 2001 From: Amir Qayyum Khan Date: Thu, 25 Feb 2016 17:02:04 +0500 Subject: [PATCH] Refactored ccx coach tab plugin --- lms/djangoapps/ccx/plugins.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lms/djangoapps/ccx/plugins.py b/lms/djangoapps/ccx/plugins.py index f01c2899be..c081f50c50 100644 --- a/lms/djangoapps/ccx/plugins.py +++ b/lms/djangoapps/ccx/plugins.py @@ -25,11 +25,12 @@ class CcxCourseTab(CourseTab): """ Returns true if CCX has been enabled and the specified user is a coach """ - if not user: - return True if not settings.FEATURES.get('CUSTOM_COURSES_EDX', False) or not course.enable_ccx: + # If ccx is not enable do not show ccx coach tab. return False if has_access(user, 'staff', course) or has_access(user, 'instructor', course): + # if user is staff or instructor then he can always see ccx coach tab. return True + # check if user has coach access. role = CourseCcxCoachRole(course.id) return role.has_user(user)