Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
E
edx-platform-release
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Code
Merge requests
1
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
32e6d481
Commit
32e6d481
authored
11 years ago
by
cahrens
Browse files
Options
Downloads
Patches
Plain Diff
pep8/pylint cleanup.
parent
f095c5fe
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
cms/djangoapps/auth/authz.py
+3
-1
3 additions, 1 deletion
cms/djangoapps/auth/authz.py
cms/djangoapps/auth/tests/test_authz.py
+2
-3
2 additions, 3 deletions
cms/djangoapps/auth/tests/test_authz.py
with
5 additions
and
4 deletions
cms/djangoapps/auth/authz.py
+
3
−
1
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
...
...
This diff is collapsed.
Click to expand it.
cms/djangoapps/auth/tests/test_authz.py
+
2
−
3
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
))
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