Commit d68650b4 by chrisndodge

Merge pull request #1786 from MITx/feature/cdodge/add-no-inheritable-metadata-on-verticals-to-xlint

per Victor, one shouldn't change the default parameter to a function, si...
parents 36c27377 b8f1b744
...@@ -356,12 +356,12 @@ def remap_namespace(module, target_location_namespace): ...@@ -356,12 +356,12 @@ def remap_namespace(module, target_location_namespace):
return module return module
def validate_no_non_editable_metadata(module_store, course_id, category, allowed=[]): def validate_no_non_editable_metadata(module_store, course_id, category, allowed=None):
''' '''
Assert that there is no metadata within a particular category that we can't support editing Assert that there is no metadata within a particular category that we can't support editing
However we always allow display_name and 'xml_attribtues' However we always allow 'display_name' and 'xml_attribtues'
''' '''
allowed = allowed + ['xml_attributes', 'display_name'] _allowed = (allowed if allowed is not None else []) + ['xml_attributes', 'display_name']
err_cnt = 0 err_cnt = 0
for module_loc in module_store.modules[course_id]: for module_loc in module_store.modules[course_id]:
...@@ -369,7 +369,7 @@ def validate_no_non_editable_metadata(module_store, course_id, category, allowed ...@@ -369,7 +369,7 @@ def validate_no_non_editable_metadata(module_store, course_id, category, allowed
if module.location.category == category: if module.location.category == category:
my_metadata = dict(own_metadata(module)) my_metadata = dict(own_metadata(module))
for key in my_metadata.keys(): for key in my_metadata.keys():
if key not in allowed: if key not in _allowed:
err_cnt = err_cnt + 1 err_cnt = err_cnt + 1
print ': found metadata on {0}. Studio will not support editing this piece of metadata, so it is not allowed. Metadata: {1} = {2}'. format(module.location.url(), key, my_metadata[key]) print ': found metadata on {0}. Studio will not support editing this piece of metadata, so it is not allowed. Metadata: {1} = {2}'. format(module.location.url(), key, my_metadata[key])
......
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