Skip to content
Snippets Groups Projects
Commit bacd728e authored by Calen Pennington's avatar Calen Pennington
Browse files

Squelch some (but not all, yet) errors during template loading

parent f970da6d
No related merge requests found
......@@ -66,7 +66,7 @@ class ABTestModule(XModule):
class ABTestDescriptor(RawDescriptor, XmlDescriptor):
module_class = ABTestModule
# template_dir_name = "abtest"
template_dir_name = "abtest"
def __init__(self, system, definition=None, **kwargs):
"""
......
......@@ -38,6 +38,7 @@ class CustomTagModule(XModule):
class CustomTagDescriptor(RawDescriptor):
""" Descriptor for custom tags. Loads the template when created."""
module_class = CustomTagModule
template_dir_name = 'customtag'
@staticmethod
def render_template(system, xml_data):
......
......@@ -31,8 +31,6 @@ def all_templates():
templates = defaultdict(list)
for category, descriptor in XModuleDescriptor.load_classes():
if category == 'course':
logging.debug(descriptor.templates())
templates[category] = descriptor.templates()
return templates
......@@ -67,7 +65,13 @@ def update_templates():
template_location = Location('i4x', 'edx', 'templates', category, Location.clean_for_url_name(template.metadata['display_name']))
try:
json_data = {'definition': {'data': template.data, 'children' : template.children}}
json_data = {
'definition': {
'data': template.data,
'children': template.children
},
'metadata': template.metadata
}
json_data['location'] = template_location.dict()
XModuleDescriptor.load_from_json(json_data, TemplateTestSystem())
......
---
metadata:
display_name: Empty
start: 2020-10-10T10:00
data: { 'textbooks' : [ ], 'wiki_slug' : null }
children: []
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment