From dcecae4f5cef8053184aa7d26e01700f001d65d6 Mon Sep 17 00:00:00 2001 From: Matthew Piatetsky <mpiatetsky@edx.org> Date: Wed, 14 Oct 2020 15:52:41 -0400 Subject: [PATCH] address comments --- common/lib/xmodule/xmodule/seq_module.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/common/lib/xmodule/xmodule/seq_module.py b/common/lib/xmodule/xmodule/seq_module.py index 1723d502b7b..984ae85097c 100644 --- a/common/lib/xmodule/xmodule/seq_module.py +++ b/common/lib/xmodule/xmodule/seq_module.py @@ -331,15 +331,15 @@ class SequenceModule(SequenceFields, ProctoringFields, XModule): # Other than the outer function here return ( block.location.block_type not in ('chapter', 'sequential', 'vertical') and - len(getattr(block, 'children', [])) == 0 + not block.has_children ) def get_children(parent): # This function is used to get the children of a block in the traversal below - if not hasattr(parent, 'children'): - return [] - else: + if parent.has_children: return parent.get_children() + else: + return [] # If any block inside a timed exam has been gated by content type gating # then gate the entire sequence. -- GitLab