Fix XBlock class loading in local resource view

Some XBlock classes were being (randomly) incorrectly loaded. This was
due to an error in the way the XBlock.load_class method was called.
Error was happening randomly because of the cache mechanism in the class
loading method. (see PLUGIN_CACHE)
This commit is contained in:
Régis Behmo
2015-06-30 19:06:45 +02:00
parent a9c67c562e
commit bbe5494df1

View File

@@ -20,7 +20,7 @@ def xblock_resource(request, block_type, uri): # pylint: disable=unused-argumen
Return a package resource for the specified XBlock.
"""
try:
xblock_class = XBlock.load_class(block_type, settings.XBLOCK_SELECT_FUNCTION)
xblock_class = XBlock.load_class(block_type, select=settings.XBLOCK_SELECT_FUNCTION)
content = xblock_class.open_local_resource(uri)
except IOError:
log.info('Failed to load xblock resource', exc_info=True)