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
6d91a9ac
Commit
6d91a9ac
authored
Oct 07, 2014
by
Alan Boudreault
Committed by
Zia Fazal
Apr 08, 2015
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix api_manager failing tests about cohorts
parent
895e4f63
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
8 deletions
+3
-8
lms/djangoapps/api_manager/users/views.py
+3
-8
No files found.
lms/djangoapps/api_manager/users/views.py
View file @
6d91a9ac
...
...
@@ -21,6 +21,7 @@ from courseware.views import get_module_for_descriptor, save_child_position, get
from
course_groups.models
import
CourseUserGroup
from
course_groups.cohorts
import
(
get_cohort_by_name
,
get_cohort
,
add_cohort
,
add_user_to_cohort
,
remove_user_from_cohort
...
...
@@ -903,15 +904,9 @@ class UsersCoursesDetail(SecureAPIView):
if
not
course_exists
(
request
,
user
,
course_id
):
return
Response
({},
status
=
status
.
HTTP_204_NO_CONTENT
)
course_key
=
get_course_key
(
course_id
)
try
:
cohort
=
CourseUserGroup
.
objects
.
get
(
course_id
=
course_key
,
users__id
=
user
.
id
,
group_type
=
CourseUserGroup
.
COHORT
,
)
cohort
=
get_cohort
(
user
,
course_key
)
if
cohort
:
remove_user_from_cohort
(
cohort
,
user
.
username
)
except
ObjectDoesNotExist
:
pass
CourseEnrollment
.
unenroll
(
user
,
course_key
)
return
Response
({},
status
=
status
.
HTTP_204_NO_CONTENT
)
...
...
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