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
9eaf7206
Commit
9eaf7206
authored
Oct 08, 2014
by
Alan Boudreault
Committed by
Jonathan Piacenti
Aug 20, 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
e9491d59
Show 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 @
9eaf7206
...
@@ -20,7 +20,6 @@ from courseware.model_data import FieldDataCache
...
@@ -20,7 +20,6 @@ from courseware.model_data import FieldDataCache
from
openedx.core.djangoapps.course_groups.models
import
CourseUserGroup
from
openedx.core.djangoapps.course_groups.models
import
CourseUserGroup
from
openedx.core.djangoapps.course_groups.cohorts
import
(
from
openedx.core.djangoapps.course_groups.cohorts
import
(
get_cohort_by_name
,
get_cohort_by_name
,
get_cohort
,
add_cohort
,
add_cohort
,
add_user_to_cohort
,
add_user_to_cohort
,
remove_user_from_cohort
remove_user_from_cohort
...
@@ -903,9 +902,15 @@ class UsersCoursesDetail(SecureAPIView):
...
@@ -903,9 +902,15 @@ class UsersCoursesDetail(SecureAPIView):
if
not
course_exists
(
request
,
user
,
course_id
):
if
not
course_exists
(
request
,
user
,
course_id
):
return
Response
({},
status
=
status
.
HTTP_204_NO_CONTENT
)
return
Response
({},
status
=
status
.
HTTP_204_NO_CONTENT
)
course_key
=
get_course_key
(
course_id
)
course_key
=
get_course_key
(
course_id
)
cohort
=
get_cohort
(
user
,
course_key
)
try
:
if
cohort
:
cohort
=
CourseUserGroup
.
objects
.
get
(
course_id
=
course_key
,
users__id
=
user
.
id
,
group_type
=
CourseUserGroup
.
COHORT
,
)
remove_user_from_cohort
(
cohort
,
user
.
username
)
remove_user_from_cohort
(
cohort
,
user
.
username
)
except
ObjectDoesNotExist
:
pass
CourseEnrollment
.
unenroll
(
user
,
course_key
)
CourseEnrollment
.
unenroll
(
user
,
course_key
)
return
Response
({},
status
=
status
.
HTTP_204_NO_CONTENT
)
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