Commit 14eb160e by Calen Pennington

Just return a null progress if something goes wrong when retrieving capa_module…

Just return a null progress if something goes wrong when retrieving capa_module progress (and log the error)
parent 897a8764
......@@ -202,10 +202,8 @@ class CapaModule(XModule):
try:
return Progress(score, total)
except Exception as err:
# TODO (vshnayder): why is this still here? still needed?
if self.system.DEBUG:
return None
raise
log.exception("Got bad progress")
return None
return None
def get_html(self):
......@@ -322,16 +320,10 @@ class CapaModule(XModule):
before = self.get_progress()
d = handlers[dispatch](get)
try:
after = self.get_progress()
d.update({
'progress_changed': after != before,
'progress_status': Progress.to_js_status_str(after),
})
except ValueError:
d.update({
'progress_changed': False,
'progress_status': Progress.to_js_status(before),
after = self.get_progress()
d.update({
'progress_changed': after != before,
'progress_status': Progress.to_js_status_str(after),
})
return json.dumps(d, cls=ComplexEncoder)
......
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