From: Guillaume Pellerin Date: Mon, 6 Jul 2020 12:07:42 +0000 (+0200) Subject: HOTFIX: force mime_type X-Git-Tag: 1.4.3~59^2 X-Git-Url: https://git.parisson.com/?a=commitdiff_plain;h=f24071108f96735062b0cfa93f536667113e2498;p=teleforma.git HOTFIX: force mime_type --- diff --git a/teleforma/exam/models.py b/teleforma/exam/models.py index 9c33c3cb..afe1338c 100755 --- a/teleforma/exam/models.py +++ b/teleforma/exam/models.py @@ -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