From: Guillaume Pellerin Date: Sat, 19 Jul 2014 18:04:25 +0000 (+0200) Subject: fix wrong format and corrector X-Git-Tag: 1.1~388 X-Git-Url: https://git.parisson.com/?a=commitdiff_plain;h=f365e6827847ff82d6bf222a1d336a887e550c93;p=teleforma.git fix wrong format and corrector --- diff --git a/teleforma/exam/models.py b/teleforma/exam/models.py index 747421cf..03bd5d20 100644 --- a/teleforma/exam/models.py +++ b/teleforma/exam/models.py @@ -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 diff --git a/teleforma/management/commands/teleforma-exam-submit-scripts.py b/teleforma/management/commands/teleforma-exam-submit-scripts.py index 1f495025..a8e93739 100644 --- a/teleforma/management/commands/teleforma-exam-submit-scripts.py +++ b/teleforma/management/commands/teleforma-exam-submit-scripts.py @@ -38,4 +38,4 @@ class Command(BaseCommand): except: logger.logger.error('ERROR') logger.logger.info('OK') - time.sleep(60) + time.sleep(30)