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
5ab8ba6e
Commit
5ab8ba6e
authored
Oct 08, 2014
by
Alan Boudreault
Committed by
Zia Fazal
Apr 08, 2015
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Reverted a minor change in get_cohort to fix failing test in course_groups
parent
6d91a9ac
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
3 deletions
+8
-3
lms/djangoapps/api_manager/users/views.py
+8
-3
No files found.
lms/djangoapps/api_manager/users/views.py
View file @
5ab8ba6e
...
...
@@ -21,7 +21,6 @@ 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
...
...
@@ -904,9 +903,15 @@ 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
)
cohort
=
get_cohort
(
user
,
course_key
)
if
cohort
:
try
:
cohort
=
CourseUserGroup
.
objects
.
get
(
course_id
=
course_key
,
users__id
=
user
.
id
,
group_type
=
CourseUserGroup
.
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