feat: add duplicate_children logging (#33829)

Add some logging to better capture the failures we've seen in duplication of library blocks.

Co-authored-by: Kyle McCormick <kyle@axim.org>
This commit is contained in:
connorhaugh
2023-11-29 12:56:24 -05:00
committed by GitHub
parent f852594f54
commit 183e04d8b1

View File

@@ -300,7 +300,13 @@ def duplicate_children(
# Then, copy over any overridden settings the course author may have applied to the blocks.
source_block = store.get_item(BlockUsageLocator.from_string(source_block_id))
with store.bulk_operations(source_block.scope_ids.usage_id.context_key):
_copy_overrides(store=store, user_id=user_id, source_block=source_block, dest_block=dest_block)
try:
TASK_LOGGER.info('Copying Overrides from %s to %s', source_block_id, dest_block_id)
_copy_overrides(store=store, user_id=user_id, source_block=source_block, dest_block=dest_block)
except Exception as exception: # pylint: disable=broad-except
TASK_LOGGER.exception('Error Copying Overrides from %s to %s', source_block_id, dest_block_id)
if self.status.state != UserTaskStatus.FAILED:
self.status.fail({'raw_error_msg': str(exception)})
def _sync_children(