Commit e9247920 by Bridger Maxwell

Moved potential failure outside of unrelated try/catch block that would have…

Moved potential failure outside of unrelated try/catch block that would have masked the missing settings.DATA_DIR
parent f987f99a
...@@ -33,13 +33,16 @@ class Settings(object): ...@@ -33,13 +33,16 @@ class Settings(object):
for setting in dir(global_course_settings): for setting in dir(global_course_settings):
if setting == setting.upper(): if setting == setting.upper():
setattr(self, setting, getattr(global_course_settings, setting)) setattr(self, setting, getattr(global_course_settings, setting))
data_dir = settings.DATA_DIR
fp = None fp = None
try: try:
fp, pathname, description = imp.find_module("course_settings", [settings.DATA_DIR]) fp, pathname, description = imp.find_module("course_settings", [data_dir])
mod = imp.load_module("course_settings", fp, pathname, description) mod = imp.load_module("course_settings", fp, pathname, description)
except Exception as e: except Exception as e:
_log.error("Unable to import course settings file from " + settings.DATA_DIR + ". Error: " + str(e)) _log.exception("Unable to import course settings file from " + data_dir + ". Error: " + str(e))
mod = types.ModuleType('course_settings') mod = types.ModuleType('course_settings')
finally: finally:
if fp: if fp:
......
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