Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
E
edx-platform-release
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Package Registry
Model registry
Operate
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Hsin-Yu Chien
edx-platform-release
Commits
8be8ac8f
Commit
8be8ac8f
authored
9 years ago
by
Amir Qayyum Khan
Browse files
Options
Downloads
Patches
Plain Diff
Refactored ccx coach tab plugin
parent
e1035c7b
Loading
Loading
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
lms/djangoapps/ccx/plugins.py
+3
-2
3 additions, 2 deletions
lms/djangoapps/ccx/plugins.py
with
3 additions
and
2 deletions
lms/djangoapps/ccx/plugins.py
+
3
−
2
View file @
8be8ac8f
...
...
@@ -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
)
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment