]> git.parisson.com Git - teleforma.git/commitdiff
fix no file
authorGuillaume Pellerin <yomguy@parisson.com>
Sat, 19 Jul 2014 20:40:22 +0000 (22:40 +0200)
committerGuillaume Pellerin <yomguy@parisson.com>
Sat, 19 Jul 2014 20:40:22 +0000 (22:40 +0200)
teleforma/management/commands/teleforma-exam-submit-scripts.py

index a8e93739960d7e9b0bef3c8a84741d8038c77a81..4e4c99cf7c47ccc32991573a0e600e4ec35e4a9f 100644 (file)
@@ -32,10 +32,13 @@ class Command(BaseCommand):
         logger = Logger(args[0])
         for script in Script.objects.filter(status=2):
             logger.logger.info(script.title)
-            script.fix_filename()
-            try:
-                script.submit()
-            except:
-                logger.logger.error('ERROR')
-            logger.logger.info('OK')
-            time.sleep(30)
+            if script.file:
+                   script.fix_filename()
+                   try:
+                       script.submit()
+                   except:
+                       logger.logger.error('ERROR')
+                   logger.logger.info('OK')
+                   time.sleep(30)
+               else:
+                       print unicode(script)