]> git.parisson.com Git - teleforma.git/commitdiff
HOTFIX: force mime_type
authorGuillaume Pellerin <guillaume.pellerin@ircam.fr>
Mon, 6 Jul 2020 12:07:42 +0000 (14:07 +0200)
committerGuillaume Pellerin <guillaume.pellerin@ircam.fr>
Mon, 6 Jul 2020 12:07:42 +0000 (14:07 +0200)
teleforma/exam/models.py

index 9c33c3cb2c5a4a66a8d09d315f46e76aa19ebdef..afe1338c99e073edb9118b8187d1b09ff327d82e 100755 (executable)
@@ -369,6 +369,9 @@ class Script(BaseResource):
             self.mark()
         elif self.status == 0 and self.reject_reason:
             self.reject()
+        #HOTFIX
+        if not self.mime_type:
+            self.mime_type = 'application/pdf'
         super(Script, self).save(*args, **kwargs)
 
     def update(self, *args, **kwargs):
@@ -521,6 +524,9 @@ def set_file_properties(sender, instance, **kwargs):
             if mime_type:
                 instance.mime_type = mimetype_file(instance.file.path)
                 trig_save = True
+            #HOTFIX
+            else:
+                instance.mime_type = 'application/pdf'
         if not instance.sha1:
             instance.sha1 = sha1sum_file(instance.file.path)
             trig_save = True