From: Guillaume Pellerin Date: Wed, 17 Apr 2024 08:23:08 +0000 (+0200) Subject: add user arg X-Git-Tag: 2.9.0~23 X-Git-Url: https://git.parisson.com/?a=commitdiff_plain;h=992bc75c593e6c130d80adbcfeccef47de959e8a;p=teleforma.git add user arg --- diff --git a/teleforma/views/core.py b/teleforma/views/core.py index 4630377c..3a55c397 100644 --- a/teleforma/views/core.py +++ b/teleforma/views/core.py @@ -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)