Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
C
course-discovery
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
course-discovery
Commits
e5f5def2
Commit
e5f5def2
authored
Jan 25, 2017
by
tasawernawaz
Committed by
Tasawer Nawaz
Jan 25, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
remove CourseTeam role from default organization roles ECOM-6929
parent
c03551f7
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
5 deletions
+11
-5
course_discovery/apps/publisher/models.py
+2
-2
course_discovery/apps/publisher/tests/test_model.py
+9
-3
No files found.
course_discovery/apps/publisher/models.py
View file @
e5f5def2
...
...
@@ -177,9 +177,9 @@ class Course(TimeStampedModel, ChangedByMixin):
def
assign_organization_role
(
self
,
organization
):
"""
Create course-user-roles for the given organization against a course.
Create course-user-roles
except CourseTeam
for the given organization against a course.
"""
for
user_role
in
organization
.
organization_user_roles
.
all
(
):
for
user_role
in
organization
.
organization_user_roles
.
exclude
(
role
=
PublisherUserRole
.
CourseTeam
):
CourseUserRole
.
add_course_roles
(
self
,
user_role
.
role
,
user_role
.
user
)
@property
...
...
course_discovery/apps/publisher/tests/test_model.py
View file @
e5f5def2
...
...
@@ -178,8 +178,8 @@ class CourseTests(TestCase):
def
test_assign_roles
(
self
):
"""
Verify that method `assign_organization_role' assign course-user-roles
for the organization against a course.
Verify that method `assign_organization_role' assign course-user-roles
except
CourseTeam role
for the organization against a course.
"""
self
.
assertFalse
(
self
.
course2
.
course_user_roles
.
all
())
...
...
@@ -188,12 +188,18 @@ class CourseTests(TestCase):
role
=
PublisherUserRole
.
PartnerCoordinator
,
organization
=
self
.
org_extension_2
.
organization
)
factories
.
OrganizationUserRoleFactory
(
role
=
PublisherUserRole
.
PartnerCoordinator
,
organization
=
self
.
org_extension_2
.
organization
role
=
PublisherUserRole
.
MarketingReviewer
,
organization
=
self
.
org_extension_2
.
organization
)
factories
.
OrganizationUserRoleFactory
(
role
=
PublisherUserRole
.
CourseTeam
,
organization
=
self
.
org_extension_2
.
organization
)
self
.
course2
.
assign_organization_role
(
self
.
org_extension_2
.
organization
)
self
.
assertEqual
(
len
(
self
.
course2
.
course_user_roles
.
all
()),
2
)
self
.
assertNotIn
(
PublisherUserRole
.
CourseTeam
,
self
.
course2
.
course_user_roles
.
all
())
def
test_assign_roles_without_default_roles
(
self
):
"""
Verify that method `assign_organization_role' works fine even if no
...
...
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