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
32e6d481
Commit
32e6d481
authored
Jun 27, 2013
by
cahrens
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
pep8/pylint cleanup.
parent
f095c5fe
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
4 deletions
+5
-4
cms/djangoapps/auth/authz.py
+3
-1
cms/djangoapps/auth/tests/test_authz.py
+2
-3
No files found.
cms/djangoapps/auth/authz.py
View file @
32e6d481
...
...
@@ -36,7 +36,7 @@ def get_course_groupname_for_role(location, role):
def
get_users_in_course_group_by_role
(
location
,
role
):
groupname
=
get_course_groupname_for_role
(
location
,
role
)
(
group
,
created
)
=
Group
.
objects
.
get_or_create
(
name
=
groupname
)
(
group
,
_
created
)
=
Group
.
objects
.
get_or_create
(
name
=
groupname
)
return
group
.
user_set
.
all
()
...
...
@@ -59,6 +59,7 @@ def create_new_course_group(creator, location, role):
return
def
_delete_course_group
(
location
):
"""
This is to be called only by either a command line code path or through a app which has already
...
...
@@ -75,6 +76,7 @@ def _delete_course_group(location):
user
.
groups
.
remove
(
staff
)
user
.
save
()
def
_copy_course_group
(
source
,
dest
):
"""
This is to be called only by either a command line code path or through an app which has already
...
...
cms/djangoapps/auth/tests/test_authz.py
View file @
32e6d481
...
...
@@ -184,8 +184,8 @@ class GrantInstructorsCreatorAccessTest(TestCase):
"""
Creates a course with one instructor and one staff member.
"""
creator
=
User
.
objects
.
create_user
(
'testcreator'
+
str
(
index
),
'testcreator+courses@edx.org'
,
'foo'
)
staff
=
User
.
objects
.
create_user
(
'teststaff'
+
str
(
index
),
'teststaff+courses@edx.org'
,
'foo'
)
creator
=
User
.
objects
.
create_user
(
'testcreator'
+
str
(
index
),
'testcreator+courses@edx.org'
,
'foo'
)
staff
=
User
.
objects
.
create_user
(
'teststaff'
+
str
(
index
),
'teststaff+courses@edx.org'
,
'foo'
)
location
=
'i4x'
,
'mitX'
,
str
(
index
),
'course'
,
'test'
create_all_course_groups
(
creator
,
location
)
add_user_to_course_group
(
creator
,
staff
,
location
,
STAFF_ROLE_NAME
)
...
...
@@ -213,4 +213,3 @@ class GrantInstructorsCreatorAccessTest(TestCase):
self
.
assertTrue
(
is_user_in_creator_group
(
creator2
))
self
.
assertFalse
(
is_user_in_creator_group
(
staff1
))
self
.
assertFalse
(
is_user_in_creator_group
(
staff2
))
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