]> git.parisson.com Git - teleforma.git/commitdiff
fix wrong format and corrector
authorGuillaume Pellerin <yomguy@parisson.com>
Sat, 19 Jul 2014 18:04:25 +0000 (20:04 +0200)
committerGuillaume Pellerin <yomguy@parisson.com>
Sat, 19 Jul 2014 18:04:25 +0000 (20:04 +0200)
teleforma/exam/models.py
teleforma/management/commands/teleforma-exam-submit-scripts.py

index 747421cf8fc60533ad0051b801d96c635e28a632..03bd5d2024588194c60bc25c5f2a076e0cecfdad 100644 (file)
@@ -308,14 +308,14 @@ class Script(BaseResource):
         # self.url = 'http://teleforma.parisson.com/media/scripts/2014/06/24/Gstreamer_monitoring_Pipleline.pdf'
         self.url = settings.MEDIA_URL + unicode(self.file)
 
-        if '.jpg' in self.file.path or '.JPG' in self.file.path \
-            or '.png' in self.file.path or '.PNG' in self.file.path:
+        if not '.pdf' in self.file.path or not '.PDF' in self.file.path:
             self.reject_reason = 'wrong format'
-            self.reject()
+            self.status = 0
+            self.corrector = User.objects.filter(is_superuser=True)[0]
 
         self.save()
 
-        if not self.box_uuid and not self.reject_reason:
+        if not self.box_uuid and not self.status == 0:
             self.box_uuid = crocodoc.document.upload(url=self.url)
 
             i = 0
index 1f495025c6db3bd1d487b7a8534e4b93ae7f044c..a8e93739960d7e9b0bef3c8a84741d8038c77a81 100644 (file)
@@ -38,4 +38,4 @@ class Command(BaseCommand):
             except:
                 logger.logger.error('ERROR')
             logger.logger.info('OK')
-            time.sleep(60)
+            time.sleep(30)