From a2ca6f96d037f7635d83aaa131cb05320de1aa1e Mon Sep 17 00:00:00 2001 From: "Dave St.Germain" Date: Wed, 29 May 2019 17:03:11 -0400 Subject: [PATCH] API support for bulk grade import/export --- lms/djangoapps/grades/api.py | 2 +- openedx/core/djangoapps/course_groups/cohorts.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lms/djangoapps/grades/api.py b/lms/djangoapps/grades/api.py index bbf2d93a5f..1d8a2deb03 100644 --- a/lms/djangoapps/grades/api.py +++ b/lms/djangoapps/grades/api.py @@ -12,7 +12,7 @@ from lms.djangoapps.grades.models_api import * from lms.djangoapps.grades.tasks import compute_all_grades_for_course as task_compute_all_grades_for_course # Public Grades Modules -from lms.djangoapps.grades import events, constants, context +from lms.djangoapps.grades import events, constants, context, course_data from lms.djangoapps.grades.signals import signals from lms.djangoapps.grades.util_services import GradesUtilService diff --git a/openedx/core/djangoapps/course_groups/cohorts.py b/openedx/core/djangoapps/course_groups/cohorts.py index cc938104db..f4d0245b45 100644 --- a/openedx/core/djangoapps/course_groups/cohorts.py +++ b/openedx/core/djangoapps/course_groups/cohorts.py @@ -219,7 +219,7 @@ def get_cohort(user, course_key, assign=True, use_cached=False): Raises: ValueError if the CourseKey doesn't exist. """ - if user.is_anonymous: + if user is None or user.is_anonymous: return None cache = RequestCache(COHORT_CACHE_NAMESPACE).data cache_key = _cohort_cache_key(user.id, course_key)