]> 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:23:08 +0000 (10:23 +0200)
teleforma/views/core.py

index 1c75422404da36497b13e9f744c4dd0669c97c45..bd6ffd847aba903893945abba80c6233804b36ee 100644 (file)
@@ -798,7 +798,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)
@@ -810,7 +810,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)