Commit cd3e3a7a by Zia Fazal Committed by Jonathan Piacenti

ziafazal/api-optimize-completions-leader-list: optimized get_course_leaf_nodes

parent 032d7e61
......@@ -57,7 +57,7 @@ def get_course_leaf_nodes(course_key, detached_categories):
nodes = []
verticals = modulestore().get_items(course_key, category='vertical')
for vertical in verticals:
nodes.extend([unit.location for unit in vertical.get_children()
nodes.extend([unit for unit in vertical.children
if getattr(unit, 'category') not in detached_categories])
return nodes
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment