From 1a0854169b2f60438f3aa024ac3e44533ef9f3a6 Mon Sep 17 00:00:00 2001 From: Charles Connell Date: Tue, 13 May 2014 10:37:06 -0400 Subject: [PATCH] Don't blow up if RequesterAnnotation isn't an integer --- karmaworld/apps/quizzes/tasks.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/karmaworld/apps/quizzes/tasks.py b/karmaworld/apps/quizzes/tasks.py index af6e677..806a4b6 100644 --- a/karmaworld/apps/quizzes/tasks.py +++ b/karmaworld/apps/quizzes/tasks.py @@ -128,8 +128,9 @@ def get_extract_keywords_results(): for hit in reviewable_hits: try: note_id = connection.get_hit(hit.HITId)[0].RequesterAnnotation - except AttributeError: - logger.error('HIT {0} does not have a RequesterAnnotation, ' + note_id = int(note_id) + except (AttributeError, ValueError): + logger.error('HIT {0} does not have a valid RequesterAnnotation, ' 'so we cannot determine which note it references'.format(hit.HITId)) return -- 2.25.1