Commit f6b4d3aa by Calen Pennington

Make the markdown attribute default to None, to distinguish it from the empty string

parent 1411fadd
......@@ -325,7 +325,7 @@ def edit_unit(request, location):
component_templates[category].append((
template.display_name_with_default,
template.location.url(),
hasattr(template, 'markdown') and template.markdown != '',
hasattr(template, 'markdown') and template.markdown is not None,
template.cms.empty,
))
......
......@@ -801,7 +801,7 @@ class CapaDescriptor(RawDescriptor):
module_class = CapaModule
weight = StringyFloat(help="How much to weight this problem by", scope=Scope.settings)
markdown = String(help="Markdown source of this module", scope=Scope.settings, default='')
markdown = String(help="Markdown source of this module", scope=Scope.settings)
stores_state = True
has_score = True
......@@ -824,7 +824,7 @@ class CapaDescriptor(RawDescriptor):
def get_context(self):
_context = RawDescriptor.get_context(self)
_context.update({'markdown': self.markdown,
'enable_markdown' : self.markdown != ''})
'enable_markdown': self.markdown is not None})
return _context
@property
......
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