Commit 9a14af4b by Victor Shnayder

address comment on #412

parent 5d9fad5a
...@@ -49,9 +49,9 @@ class ABTestModule(XModule): ...@@ -49,9 +49,9 @@ class ABTestModule(XModule):
return json.dumps({'group': self.group}) return json.dumps({'group': self.group})
def displayable_items(self): def displayable_items(self):
return filter(None, [self.system.get_module(child) child_locations = self.definition['data']['group_content'][self.group]
for child children = [self.system.get_module(loc) for loc in child_locations]
in self.definition['data']['group_content'][self.group]]) return [c for c in children if c is not None]
# TODO (cpennington): Use Groups should be a first class object, rather than being # TODO (cpennington): Use Groups should be a first class object, rather than being
......
...@@ -219,11 +219,11 @@ class XModule(HTMLSnippet): ...@@ -219,11 +219,11 @@ class XModule(HTMLSnippet):
Return module instances for all the children of this module. Return module instances for all the children of this module.
''' '''
if self._loaded_children is None: if self._loaded_children is None:
child_locations = self.definition.get('children', [])
children = [self.system.get_module(loc) for loc in child_locations]
# get_module returns None if the current user doesn't have access # get_module returns None if the current user doesn't have access
# to the location. # to the location.
self._loaded_children = filter(None, self._loaded_children = [c for c in children if c is not None]
[self.system.get_module(child)
for child in self.definition.get('children', [])])
return self._loaded_children return self._loaded_children
......
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