]> git.parisson.com Git - teleforma.git/commitdiff
add user arg
authorGuillaume Pellerin <guillaume.pellerin@free.fr>
Wed, 17 Apr 2024 08:23:08 +0000 (10:23 +0200)
committerGuillaume Pellerin <guillaume.pellerin@free.fr>
Wed, 17 Apr 2024 08:25:55 +0000 (10:25 +0200)
teleforma/views/core.py

index 4630377cdae5bf17661e4a672f47f38448e75098..3a55c397e1587007fbef38daddd134f48f61ff89 100644 (file)
@@ -820,7 +820,7 @@ class DocumentView(CourseAccessMixin, DetailView):
         document = Document.objects.get(pk=pk)
         if get_access(document, courses):
             if settings.TELEFORMA_PRIVATE_DOCUMENTS_MODE:
-                path = document.private_file.path
+                path = document.private_file(request.user).path
             else:
                 path = document.file.path
             return serve_media(path, streaming=False)
@@ -832,7 +832,7 @@ class DocumentView(CourseAccessMixin, DetailView):
         document = Document.objects.get(pk=pk)
         if get_access(document, courses):
             if settings.TELEFORMA_PRIVATE_DOCUMENTS_MODE:
-                path = document.private_file.path
+                path = document.private_file(request.user).path
             else:
                 path = document.file.path
             return serve_media(path, streaming=True)