Commit 701eac33 by Don Mitchell

get_courses doesn't return ErrorDescriptor

parent a2ce7033
......@@ -557,7 +557,7 @@ class MongoModuleStore(ModuleStoreWriteBase):
'''
Returns a list of course descriptors.
'''
return sum(
base_list = sum(
[
self._load_items(
SlashSeparatedCourseKey(course['_id']['org'], course['_id']['course'], course['_id']['name']),
......@@ -574,6 +574,7 @@ class MongoModuleStore(ModuleStoreWriteBase):
],
[]
)
return [course for course in base_list if not isinstance(course, ErrorDescriptor)]
def _find_one(self, location):
'''Look for a given location in the collection. If revision is not
......
......@@ -70,6 +70,7 @@ from bson.objectid import ObjectId
from xmodule.modulestore.split_mongo.mongo_connection import MongoConnection
from xblock.core import XBlock
from xmodule.modulestore.loc_mapper_store import LocMapperStore
from xmodule.error_module import ErrorDescriptor
log = logging.getLogger(__name__)
#==============================================================================
......@@ -313,7 +314,9 @@ class SplitMongoModuleStore(ModuleStoreWriteBase):
'structure': entry,
}
root = entry['root']
result.extend(self._load_items(envelope, [root], 0, lazy=True))
course_list = self._load_items(envelope, [root], 0, lazy=True)
if not isinstance(course_list[0], ErrorDescriptor):
result.append(course_list[0])
return result
def get_course(self, course_id, depth=None):
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment