Don't let one error halt document indexing
authorCharles Connell <charles@connells.org>
Tue, 31 Dec 2013 04:31:11 +0000 (23:31 -0500)
committerCharles Connell <charles@connells.org>
Tue, 31 Dec 2013 04:31:11 +0000 (23:31 -0500)
karmaworld/apps/notes/management/commands/populate_indexden.py

index 4573b8c2088933694a82512cb093f648e460c477..421c0cc5cb68bddfe2a0de8a8dc03fa7c58df299 100644 (file)
@@ -16,6 +16,9 @@ class Command(BaseCommand):
         notes = Note.objects.all()
 
         for note in notes:
-            print "Indexing {n}".format(n=note)
-            add_document(note)
+            try:
+                print "Indexing {n}".format(n=note)
+                add_document(note)
+            except:
+                continue