API support for bulk grade import/export

This commit is contained in:
Dave St.Germain
2019-05-29 17:03:11 -04:00
parent 69496576ee
commit a2ca6f96d0
2 changed files with 2 additions and 2 deletions

View File

@@ -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

View File

@@ -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)