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
fa50aa2e
Commit
fa50aa2e
authored
Jul 28, 2014
by
Sarina Canelake
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #4588 from edx/sarina/fix-legacy-cohorts
Fix call to cohorts
parents
b22a8249
eafa6b22
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
12 deletions
+12
-12
common/djangoapps/course_groups/views.py
+12
-12
No files found.
common/djangoapps/course_groups/views.py
View file @
fa50aa2e
...
...
@@ -34,7 +34,7 @@ def split_by_comma_and_whitespace(s):
@ensure_csrf_cookie
def
list_cohorts
(
request
,
course_key
):
def
list_cohorts
(
request
,
course_key
_string
):
"""
Return json dump of dict:
...
...
@@ -43,7 +43,7 @@ def list_cohorts(request, course_key):
"""
# this is a string when we get it here
course_key
=
SlashSeparatedCourseKey
.
from_deprecated_string
(
course_key
)
course_key
=
SlashSeparatedCourseKey
.
from_deprecated_string
(
course_key
_string
)
get_course_with_access
(
request
.
user
,
'staff'
,
course_key
)
...
...
@@ -56,7 +56,7 @@ def list_cohorts(request, course_key):
@ensure_csrf_cookie
@require_POST
def
add_cohort
(
request
,
course_key
):
def
add_cohort
(
request
,
course_key
_string
):
"""
Return json of dict:
{'success': True,
...
...
@@ -69,7 +69,7 @@ def add_cohort(request, course_key):
'msg': error_msg} if there's an error
"""
# this is a string when we get it here
course_key
=
SlashSeparatedCourseKey
.
from_deprecated_string
(
course_key
)
course_key
=
SlashSeparatedCourseKey
.
from_deprecated_string
(
course_key
_string
)
get_course_with_access
(
request
.
user
,
'staff'
,
course_key
)
...
...
@@ -92,7 +92,7 @@ def add_cohort(request, course_key):
@ensure_csrf_cookie
def
users_in_cohort
(
request
,
course_key
,
cohort_id
):
def
users_in_cohort
(
request
,
course_key
_string
,
cohort_id
):
"""
Return users in the cohort. Show up to 100 per page, and page
using the 'page' GET attribute in the call. Format:
...
...
@@ -106,7 +106,7 @@ def users_in_cohort(request, course_key, cohort_id):
}
"""
# this is a string when we get it here
course_key
=
SlashSeparatedCourseKey
.
from_deprecated_string
(
course_key
)
course_key
=
SlashSeparatedCourseKey
.
from_deprecated_string
(
course_key
_string
)
get_course_with_access
(
request
.
user
,
'staff'
,
course_key
)
...
...
@@ -140,7 +140,7 @@ def users_in_cohort(request, course_key, cohort_id):
@ensure_csrf_cookie
@require_POST
def
add_users_to_cohort
(
request
,
course_key
,
cohort_id
):
def
add_users_to_cohort
(
request
,
course_key
_string
,
cohort_id
):
"""
Return json dict of:
...
...
@@ -156,7 +156,7 @@ def add_users_to_cohort(request, course_key, cohort_id):
'unknown': [str1, str2, ...]}
"""
# this is a string when we get it here
course_key
=
SlashSeparatedCourseKey
.
from_deprecated_string
(
course_key
)
course_key
=
SlashSeparatedCourseKey
.
from_deprecated_string
(
course_key
_string
)
get_course_with_access
(
request
.
user
,
'staff'
,
course_key
)
cohort
=
cohorts
.
get_cohort_by_id
(
course_key
,
cohort_id
)
...
...
@@ -196,7 +196,7 @@ def add_users_to_cohort(request, course_key, cohort_id):
@ensure_csrf_cookie
@require_POST
def
remove_user_from_cohort
(
request
,
course_key
,
cohort_id
):
def
remove_user_from_cohort
(
request
,
course_key
_string
,
cohort_id
):
"""
Expects 'username': username in POST data.
...
...
@@ -207,7 +207,7 @@ def remove_user_from_cohort(request, course_key, cohort_id):
'msg': error_msg}
"""
# this is a string when we get it here
course_key
=
SlashSeparatedCourseKey
.
from_deprecated_string
(
course_key
)
course_key
=
SlashSeparatedCourseKey
.
from_deprecated_string
(
course_key
_string
)
get_course_with_access
(
request
.
user
,
'staff'
,
course_key
)
username
=
request
.
POST
.
get
(
'username'
)
...
...
@@ -226,12 +226,12 @@ def remove_user_from_cohort(request, course_key, cohort_id):
'msg'
:
"No user '{0}'"
.
format
(
username
)})
def
debug_cohort_mgmt
(
request
,
course_key
):
def
debug_cohort_mgmt
(
request
,
course_key
_string
):
"""
Debugging view for dev.
"""
# this is a string when we get it here
course_key
=
SlashSeparatedCourseKey
.
from_deprecated_string
(
course_key
)
course_key
=
SlashSeparatedCourseKey
.
from_deprecated_string
(
course_key
_string
)
# add staff check to make sure it's safe if it's accidentally deployed.
get_course_with_access
(
request
.
user
,
'staff'
,
course_key
)
...
...
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