Commit 7f8543a2 by Calen Pennington

Clean up logging in import_export.py

parent 9dc48c00
...@@ -329,7 +329,7 @@ def export_handler(request, course_key_string): ...@@ -329,7 +329,7 @@ def export_handler(request, course_key_string):
with tarfile.open(name=export_file.name, mode='w:gz') as tar_file: with tarfile.open(name=export_file.name, mode='w:gz') as tar_file:
tar_file.add(root_dir / name, arcname=name) tar_file.add(root_dir / name, arcname=name)
except SerializationError as exc: except SerializationError as exc:
logging.exception('There was an error exporting course {0}. {1}'.format(course_module.location, unicode(exc))) log.exception('There was an error exporting course %s', course_module.id)
unit = None unit = None
failed_item = None failed_item = None
parent = None parent = None
...@@ -355,8 +355,8 @@ def export_handler(request, course_key_string): ...@@ -355,8 +355,8 @@ def export_handler(request, course_key_string):
'course_home_url': reverse_course_url("course_handler", course_key), 'course_home_url': reverse_course_url("course_handler", course_key),
'export_url': export_url 'export_url': export_url
}) })
except Exception, exc: except Exception as exc:
logging.exception('There was an error exporting course {0}. {1}'.format(course_module.location, unicode(exc))) log.exception('There was an error exporting course %s', course_module.id)
return render_to_response('export.html', { return render_to_response('export.html', {
'context_course': course_module, 'context_course': course_module,
'in_err': True, 'in_err': True,
......
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