From f6b4d3aa46e9bedde94bdba9c3a8d445420a5ffb Mon Sep 17 00:00:00 2001 From: Calen Pennington Date: Tue, 12 Mar 2013 10:50:14 -0400 Subject: [PATCH] Make the markdown attribute default to None, to distinguish it from the empty string --- cms/djangoapps/contentstore/views.py | 2 +- common/lib/xmodule/xmodule/capa_module.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/cms/djangoapps/contentstore/views.py b/cms/djangoapps/contentstore/views.py index 4ae59f5656..d9fc562f17 100644 --- a/cms/djangoapps/contentstore/views.py +++ b/cms/djangoapps/contentstore/views.py @@ -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, )) diff --git a/common/lib/xmodule/xmodule/capa_module.py b/common/lib/xmodule/xmodule/capa_module.py index f457891525..7b15ea4b73 100644 --- a/common/lib/xmodule/xmodule/capa_module.py +++ b/common/lib/xmodule/xmodule/capa_module.py @@ -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