Merge pull request #1819 from MITx/feature/ichuang/fix-edit-links-and-giturl

make "edit" links work - fixes giturl (was broken by xblocks migration)
This commit is contained in:
chrisndodge
2013-04-08 08:17:31 -07:00
5 changed files with 37 additions and 5 deletions

View File

@@ -8,7 +8,8 @@ INHERITABLE_METADATA = (
# How many days early to show a course element to beta testers (float)
# intended to be set per-course, but can be overridden in for specific
# elements. Can be a float.
'days_early_for_beta'
'days_early_for_beta',
'giturl' # for git edit link
)
def compute_inherited_metadata(descriptor):

View File

@@ -102,6 +102,7 @@ class XmlDescriptor(XModuleDescriptor):
'start', 'due', 'graded', 'display_name', 'url_name', 'hide_from_toc',
'ispublic', # if True, then course is listed for all users; see
'xqa_key', # for xqaa server access
'giturl', # url of git server for origin of file
# information about testcenter exams is a dict (of dicts), not a string,
# so it cannot be easily exportable as a course element's attribute.
'testcenter_info',
@@ -222,6 +223,7 @@ class XmlDescriptor(XModuleDescriptor):
definition, children = cls.definition_from_xml(definition_xml, system)
if definition_metadata:
definition['definition_metadata'] = definition_metadata
definition['filename'] = [ filepath, filename ]
return definition, children
@@ -315,6 +317,7 @@ class XmlDescriptor(XModuleDescriptor):
model_data['children'] = children
model_data['xml_attributes'] = {}
model_data['xml_attributes']['filename'] = definition.get('filename', ['', None]) # for git link
for key, value in metadata.items():
if key not in set(f.name for f in cls.fields + cls.lms.fields):
model_data['xml_attributes'][key] = value