Commit 222b0ae3 by Braden MacDonald

Fix upgrade error when <message> has no 'type' specified explicitly

parent ee363edf
...@@ -159,7 +159,8 @@ class MentoringMessageBlock(XBlock, StudioEditableXBlockMixin): ...@@ -159,7 +159,8 @@ class MentoringMessageBlock(XBlock, StudioEditableXBlockMixin):
""" """
block = runtime.construct_xblock_from_class(cls, keys) block = runtime.construct_xblock_from_class(cls, keys)
block.content = unicode(node.text or u"") block.content = unicode(node.text or u"")
block.type = node.attrib['type'] if 'type' in node.attrib: # 'type' is optional - default is 'completed'
block.type = node.attrib['type']
for child in node: for child in node:
block.content += etree.tostring(child, encoding='unicode') block.content += etree.tostring(child, encoding='unicode')
......
...@@ -31,7 +31,7 @@ ...@@ -31,7 +31,7 @@
<pb-tip values='["elegance","beauty"]'>This is something everyone has to like about this MRQ</pb-tip> <pb-tip values='["elegance","beauty"]'>This is something everyone has to like about this MRQ</pb-tip>
<pb-tip values='["bugs"]'>Nah, there aren't any!</pb-tip> <pb-tip values='["bugs"]'>Nah, there aren't any!</pb-tip>
</pb-mrq> </pb-mrq>
<pb-message type="completed"> <pb-message>
<p>Congratulations!</p> <p>Congratulations!</p>
</pb-message> </pb-message>
<pb-message type="incomplete"> <pb-message type="incomplete">
......
...@@ -56,7 +56,7 @@ Changes from the original: ...@@ -56,7 +56,7 @@ Changes from the original:
<message type="on-submit">Thank you for answering!</message> <message type="on-submit">Thank you for answering!</message>
</mrq> </mrq>
<message type="completed"> <message>
<html><p>Congratulations!</p></html> <html><p>Congratulations!</p></html>
</message> </message>
<message type="incomplete"> <message type="incomplete">
......
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