Don't blow up if RequesterAnnotation isn't an integer
authorCharles Connell <charles@connells.org>
Tue, 13 May 2014 14:37:06 +0000 (10:37 -0400)
committerCharles Connell <charles@connells.org>
Tue, 13 May 2014 14:37:06 +0000 (10:37 -0400)
karmaworld/apps/quizzes/tasks.py

index af6e67765f0684e5048321eeea5808332947d70f..806a4b6325622a2ab9018c899b286dd1b043a1ff 100644 (file)
@@ -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