]> git.parisson.com Git - teleforma.git/commitdiff
fix no private_document.file on view
authorGuillaume Pellerin <guillaume.pellerin@free.fr>
Mon, 6 May 2024 09:09:42 +0000 (11:09 +0200)
committerGuillaume Pellerin <guillaume.pellerin@free.fr>
Mon, 6 May 2024 09:10:01 +0000 (11:10 +0200)
teleforma/models/core.py

index 8756421488e1ecce56e7ce3115727a7c6049d24b..3a3d10925bc71527cf27154621644f935a6a311a 100644 (file)
@@ -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