From f24071108f96735062b0cfa93f536667113e2498 Mon Sep 17 00:00:00 2001 From: Guillaume Pellerin Date: Mon, 6 Jul 2020 14:07:42 +0200 Subject: [PATCH] HOTFIX: force mime_type --- teleforma/exam/models.py | 6 ++++++ 1 file changed, 6 insertions(+) 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 -- 2.39.5