Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
E
edx-platform
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
edx
edx-platform
Commits
76074442
Commit
76074442
authored
Aug 05, 2012
by
ichuang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix bug: course staff group based on dir_name, not course number
parent
553f7046
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
3 deletions
+3
-3
lms/djangoapps/courseware/courses.py
+3
-3
No files found.
lms/djangoapps/courseware/courses.py
View file @
76074442
...
...
@@ -123,9 +123,9 @@ def course_staff_group_name(course):
if
type
(
course
)
==
str
:
coursename
=
course
else
:
coursename
=
course
.
metadata
.
get
(
'course'
,
''
)
if
not
coursename
:
# Fall 2012: not all course.xml have metadata correct yet
coursename
=
course
.
metadata
.
get
(
'data_dir'
,
'UnknownCourseName'
)
if
not
coursename
:
# Fall 2012: not all course.xml have metadata correct yet
coursename
=
course
.
metadata
.
get
(
'course'
,
''
)
return
'staff_
%
s'
%
coursename
def
has_staff_access_to_course
(
user
,
course
):
...
...
@@ -138,8 +138,8 @@ def has_staff_access_to_course(user,course):
if
user
.
is_staff
:
return
True
user_groups
=
[
x
[
1
]
for
x
in
user
.
groups
.
values_list
()]
# note this is the Auth group, not UserTestGroup
log
.
debug
(
'user is in groups
%
s'
%
user_groups
)
staff_group
=
course_staff_group_name
(
course
)
log
.
debug
(
'course
%
s user
%
s groups
%
s'
%
(
staff_group
,
user
,
user_groups
))
if
staff_group
in
user_groups
:
return
True
return
False
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment