Commit e9dacfae by Vasyl Nakvasiuk

remove `self.contents` from `ConditionalModule`

parent 9186e617
...@@ -59,10 +59,6 @@ class ConditionalModule(XModule): ...@@ -59,10 +59,6 @@ class ConditionalModule(XModule):
'voted': 'voted' # poll_question attr 'voted': 'voted' # poll_question attr
} }
def __init__(self, *args, **kwargs):
XModule.__init__(self, *args, **kwargs)
self.contents = None
def _get_condition(self): def _get_condition(self):
# Get first valid condition. # Get first valid condition.
for xml_attr, attr_name in self.conditions_map.iteritems(): for xml_attr, attr_name in self.conditions_map.iteritems():
...@@ -119,11 +115,7 @@ class ConditionalModule(XModule): ...@@ -119,11 +115,7 @@ class ConditionalModule(XModule):
context) context)
return json.dumps({'html': [html], 'message': bool(message)}) return json.dumps({'html': [html], 'message': bool(message)})
if self.contents is None: html = [child.get_html() for child in self.get_display_items()]
self.contents = [child.get_html() for child in
self.get_display_items()]
html = self.contents
return json.dumps({'html': html}) return json.dumps({'html': html})
......
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