From: Guillaume Pellerin Date: Mon, 6 May 2024 09:09:42 +0000 (+0200) Subject: fix no private_document.file on view X-Git-Tag: 2.11.0~18 X-Git-Url: https://git.parisson.com/?a=commitdiff_plain;h=d7746e64fb0ddfa3400b674973acd7a1a6cd019c;p=teleforma.git fix no private_document.file on view --- diff --git a/teleforma/models/core.py b/teleforma/models/core.py index 87564214..3a3d1092 100644 --- a/teleforma/models/core.py +++ b/teleforma/models/core.py @@ -858,6 +858,9 @@ class Document(MediaBase): except: private_documents = DocumentPrivate.objects.filter(document=self, user=user) private_document = private_documents[0] + if not private_document.file: + private_document.file = self.file + private_document.save() return private_document.file