Set defaults for org and course, and log error messages when they are used

This commit is contained in:
Calen Pennington
2012-07-10 09:23:40 -04:00
parent cfa389e357
commit 115a572fd0

View File

@@ -57,8 +57,20 @@ class XMLModuleStore(ModuleStore):
course_data = etree.parse(course_file).getroot()
org = course_data.get('org')
if org is None:
log.error("No 'org' attribute set for course in {dir}. Using default 'edx'".format(dir=course_dir))
org = 'edx'
course = course_data.get('course')
if course is None:
log.error("No 'course' attribute set for course in {dir}. Using default '{default}'".format(
dir=course_dir,
default=course_dir
))
course = course_dir
class ImportSystem(XMLParsingSystem, MakoDescriptorSystem):
def __init__(self, modulestore):
"""