republish lessons - don't stop on exceptions
authorJan Szejko <janek37@gmail.com>
Wed, 25 Jan 2017 13:29:25 +0000 (14:29 +0100)
committerJan Szejko <janek37@gmail.com>
Wed, 25 Jan 2017 13:29:25 +0000 (14:29 +0100)
catalogue/management/commands/republish.py

index d02eded..63e072d 100644 (file)
@@ -21,7 +21,11 @@ class Command(BaseCommand):
         for lesson in Lesson.objects.all():
             print
             print 'Republishing: %s' % lesson.slug
-            lesson.republish(repackage_level=False, attachments=attachments)
+            try:
+                lesson.republish(repackage_level=False)
+            except BaseException as e:
+                print '!!!!!! EXCEPTION !!!!!!'
+                print e
 
         print 'Rebuilding levels...'
         for level in Level.objects.all():