From 03a1ef3337a31483f2f57cf4068a937e9a4f9b5d Mon Sep 17 00:00:00 2001 From: Benjamin Dauvergne Date: Wed, 23 Jan 2013 11:00:23 +0100 Subject: [PATCH] send-to-mycourse: only save result in case of failure, log result as proper ASCII --- polynum_blackboard/management/commands/send-to-mycourse.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/polynum_blackboard/management/commands/send-to-mycourse.py b/polynum_blackboard/management/commands/send-to-mycourse.py index 76e74a5..c4aafed 100644 --- a/polynum_blackboard/management/commands/send-to-mycourse.py +++ b/polynum_blackboard/management/commands/send-to-mycourse.py @@ -51,10 +51,10 @@ class Command(BaseCommand): try: ok, result = conn.send_file(push.request.uploadfile, [push.course_name], push.visible_to_students) push.sent = True - if ok: + if not ok: logger.info('sending succeeded') push.failure = result - logger.error('sending failed: %s', result.encode('utf-8')) + logger.error('sending failed: %r', result.encode('utf-8')) except Exception, e: logger.exception('sending failed') push.failure = unicode(e)