Commit 3e84de32 by Alan Boudreault

Better fix for MentoringBlock attributes saving.

parent b1e05c75
...@@ -127,7 +127,7 @@ class LightChildrenMixin(XBlockWithChildrenFragmentsMixin): ...@@ -127,7 +127,7 @@ class LightChildrenMixin(XBlockWithChildrenFragmentsMixin):
return return
node = etree.parse(StringIO(self.xml_content)).getroot() node = etree.parse(StringIO(self.xml_content)).getroot()
LightChildrenMixin.init_block_from_node(self, node, {}) LightChildrenMixin.init_block_from_node(self, node, node.items())
def get_children_objects(self): def get_children_objects(self):
""" """
......
...@@ -179,7 +179,7 @@ class MentoringBlock(XBlockWithLightChildren): ...@@ -179,7 +179,7 @@ class MentoringBlock(XBlockWithLightChildren):
xml_content = submissions['xml_content'] xml_content = submissions['xml_content']
try: try:
xml = etree.parse(StringIO(xml_content)) etree.parse(StringIO(xml_content))
except etree.XMLSyntaxError as e: except etree.XMLSyntaxError as e:
response = { response = {
'result': 'error', 'result': 'error',
...@@ -191,14 +191,6 @@ class MentoringBlock(XBlockWithLightChildren): ...@@ -191,14 +191,6 @@ class MentoringBlock(XBlockWithLightChildren):
} }
self.xml_content = xml_content self.xml_content = xml_content
try:
self.url_name = xml.getroot().attrib['url_name']
except KeyError as e:
response = {
'result': 'error',
'message': 'mentoring "url_name" attribute is missing'
}
log.debug(u'Response from Studio: {}'.format(response)) log.debug(u'Response from Studio: {}'.format(response))
return response return response
......
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