Commit 48fd5952 by Kelketek

Merge pull request #42 from open-craft/export-bugfixes

Export bugfixes
parents 472a3130 8d6fcbfd
......@@ -172,6 +172,8 @@ class DataExportBlock(XBlock):
return {'error': 'permission denied'}
from .tasks import export_data as export_data_task # Import here since this is edX LMS specific
self._delete_export()
# Make sure we nail down our state before sending off an asynchronous task.
self.save()
if not username:
user_id = None
else:
......
......@@ -26,7 +26,7 @@ function DataExportBlock(runtime, element) {
}
function updateStatus(newStatus) {
var statusChanged = newStatus !== status;
var statusChanged = ! _.isEqual(newStatus, status);
status = newStatus;
if (status.export_pending) {
// Keep polling for status updates when an export is running.
......
......@@ -9,6 +9,7 @@ from instructor_task.models import ReportStore
from opaque_keys import InvalidKeyError
from opaque_keys.edx.keys import UsageKey, CourseKey
from xmodule.modulestore.django import modulestore
from xmodule.modulestore.exceptions import ItemNotFoundError
from .mcq import MCQBlock, RatingBlock
from problem_builder import AnswerBlock
......@@ -56,7 +57,11 @@ def export_data(course_id, source_block_id_str, block_types, user_id, get_root=T
blocks_to_include.append(block)
elif block.has_children:
for child_id in block.children:
scan_for_blocks(block.runtime.get_block(child_id))
try:
scan_for_blocks(block.runtime.get_block(child_id))
except ItemNotFoundError:
# Blocks may refer to missing children. Don't break in this case.
pass
scan_for_blocks(root)
......
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