Merge pull request #22404 from edx/dsheraz/PROD-964
conditional logs to find the inconsistent block id in MITx course
This commit is contained in:
@@ -3,6 +3,8 @@ Common utilities for the course experience, including course outline.
|
||||
"""
|
||||
from __future__ import absolute_import
|
||||
|
||||
import logging
|
||||
|
||||
from completion.models import BlockCompletion
|
||||
from django.utils.translation import ugettext as _
|
||||
from opaque_keys.edx.keys import CourseKey
|
||||
@@ -22,6 +24,8 @@ from openedx.features.discounts.applicability import (
|
||||
from openedx.features.discounts.utils import format_strikeout_price
|
||||
from xmodule.modulestore.django import modulestore
|
||||
|
||||
log = logging.getLogger(__name__)
|
||||
|
||||
|
||||
@request_cached()
|
||||
def get_course_outline_block_tree(request, course_id, user=None):
|
||||
@@ -44,7 +48,16 @@ def get_course_outline_block_tree(request, course_id, user=None):
|
||||
|
||||
for i in range(len(children)):
|
||||
child_id = block['children'][i]
|
||||
child_detail = populate_children(all_blocks[child_id], all_blocks)
|
||||
try:
|
||||
child_detail = populate_children(all_blocks[child_id], all_blocks)
|
||||
except TypeError:
|
||||
if u"MITx+6.002x+MITx_2012_Alumni" in course_outline_root_block[id]:
|
||||
log.info(u"PopulateChildrenError for Child: {child} in block:{block} at index:{index}".format(
|
||||
child=child_id,
|
||||
block=block['id'],
|
||||
index=i
|
||||
))
|
||||
raise
|
||||
block['children'][i] = child_detail
|
||||
|
||||
return block
|
||||
|
||||
Reference in New Issue
Block a user