changed the way public filenames (i.e., for download and exporting) are generated. #94

This commit is contained in:
jonaswinkler
2020-12-06 19:03:45 +01:00
parent a079c310b4
commit 28622d700d
6 changed files with 55 additions and 34 deletions

View File

@@ -145,11 +145,11 @@ class DocumentViewSet(RetrieveModelMixin,
doc = Document.objects.get(id=pk)
if not self.original_requested(request) and os.path.isfile(doc.archive_path): # NOQA: E501
file_handle = doc.archive_file
filename = doc.archive_file_name
filename = doc.get_public_filename(archive=True)
mime_type = 'application/pdf'
else:
file_handle = doc.source_file
filename = doc.file_name
filename = doc.get_public_filename()
mime_type = doc.mime_type
if doc.storage_type == Document.STORAGE_TYPE_GPG: