Minor cleanups
This commit is contained in:
@@ -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
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user