Commit fff9afde by Don Mitchell

Minor cleanups

parent b8f530e8
......@@ -441,7 +441,7 @@ class ContentStoreTest(TestCase):
def test_capa_module(self):
"""Test that a problem w/ markdown has markdown and uses the right html etc"""
"""Test that a problem treats markdown specially."""
CourseFactory.create(org='MITx', course='999', display_name='Robot Super Course')
problem_data = {
......
......@@ -685,13 +685,12 @@ class CapaDescriptor(RawDescriptor):
_context.update({'markdown': self.metadata.get('markdown', '')})
return _context
# overriding super's definition in a way which may get out of sync. It could call the super definition and
# then remove the 'markdown' property, but that seems expensive. Can't add markdown to system_metadata_fields
# because that prevents save_item from saving changes to it. We may want a list of metadata fields that are
# editable only via specific editors?
@property
def editable_metadata_fields(self):
subset = [name for name in self.metadata.keys() if name != 'markdown' and name not in self.system_metadata_fields]
"""Remove metadata from the editable fields since it has its own editor"""
subset = super(CapaDescriptor,self).editable_metadata_fields
if 'markdown' in subset:
subset.remove('markdown')
return subset
......
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