Skip to content
Snippets Groups Projects
Unverified Commit 260c7e32 authored by Rabia Iftikhar's avatar Rabia Iftikhar Committed by GitHub
Browse files

Merge pull request #19267 from edx/ri/EDUCATOR-3615-split_test-module

EDUCATOR-3615 make code defensive if self.child is None in log_child_render method
parents 2dfa24d4 633a3a5d
No related branches found
No related tags found
No related merge requests found
......@@ -333,8 +333,18 @@ class SplitTestModule(SplitTestFields, XModule, StudioEditableModule):
Record in the tracking logs which child was rendered
"""
# TODO: use publish instead, when publish is wired to the tracking logs
self.system.track_function('xblock.split_test.child_render', {'child_id': text_type(self.child.scope_ids.usage_id)})
return Response()
try:
child_id = text_type(self.child.scope_ids.usage_id)
except Exception:
log.info(
"Can't get usage_id of Nonetype object in course {course_key}".format(
course_key=unicode(self.location.course_key)
)
)
raise
else:
self.system.track_function('xblock.split_test.child_render', {'child_id': child_id})
return Response()
def get_icon_class(self):
return self.child.get_icon_class() if self.child else 'other'
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment