From: Charles Connell Date: Tue, 13 May 2014 14:37:06 +0000 (-0400) Subject: Don't blow up if RequesterAnnotation isn't an integer X-Git-Tag: release-20150131~87 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=1a0854169b2f60438f3aa024ac3e44533ef9f3a6;p=oweals%2Fkarmaworld.git Don't blow up if RequesterAnnotation isn't an integer --- 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