Commit 42901b10 by Braden MacDonald

Merge pull request #37 from open-craft/fix-upgrade-error

Fix upgrade error when <message> has no 'type' specified explicitly
parents f9aeb060 222b0ae3
......@@ -159,6 +159,7 @@ class MentoringMessageBlock(XBlock, StudioEditableXBlockMixin):
"""
block = runtime.construct_xblock_from_class(cls, keys)
block.content = unicode(node.text or u"")
if 'type' in node.attrib: # 'type' is optional - default is 'completed'
block.type = node.attrib['type']
for child in node:
block.content += etree.tostring(child, encoding='unicode')
......
......@@ -31,7 +31,7 @@
<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-mrq>
<pb-message type="completed">
<pb-message>
<p>Congratulations!</p>
</pb-message>
<pb-message type="incomplete">
......
......@@ -56,7 +56,7 @@ Changes from the original:
<message type="on-submit">Thank you for answering!</message>
</mrq>
<message type="completed">
<message>
<html><p>Congratulations!</p></html>
</message>
<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