From eafa6b22275400719a813cc9f3c04f091e9ae927 Mon Sep 17 00:00:00 2001 From: Sarina Canelake <sarina@edx.org> Date: Mon, 28 Jul 2014 15:57:58 -0400 Subject: [PATCH] Fix call to cohorts --- common/djangoapps/course_groups/views.py | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/common/djangoapps/course_groups/views.py b/common/djangoapps/course_groups/views.py index 1341b47..e717f25 100644 --- a/common/djangoapps/course_groups/views.py +++ b/common/djangoapps/course_groups/views.py @@ -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) -- libgit2 0.26.0