TypeError: unorderable types: int() <= MagicMock()
This commit is contained in:
Awais Qureshi
2019-09-03 23:17:11 +05:00
parent 3205cdab5f
commit 8b0bb0a707
2 changed files with 2 additions and 2 deletions

View File

@@ -622,7 +622,7 @@ def get_current_child(xmodule, min_depth=None, requested_child=None):
children = xmodule.get_display_items()
if len(children) > 0:
if xmodule.position is not None and not requested_child:
pos = xmodule.position - 1 # position is 1-indexed
pos = int(xmodule.position) - 1 # position is 1-indexed
if 0 <= pos < len(children):
child = children[pos]
if min_depth is not None and (min_depth > 0 and not child.has_children_at_depth(min_depth - 1)):