Chore: Bulk backend dependency updates (#8212)

This commit is contained in:
Trenton H
2024-11-11 11:54:51 -08:00
committed by GitHub
parent a6f4c75a72
commit d1f255a22e
8 changed files with 1883 additions and 1514 deletions

View File

@@ -1499,7 +1499,7 @@ class BulkDownloadView(GenericAPIView):
follow_filename_format = serializer.validated_data.get("follow_formatting")
settings.SCRATCH_DIR.mkdir(parents=True, exist_ok=True)
temp = tempfile.NamedTemporaryFile(
temp = tempfile.NamedTemporaryFile( # noqa: SIM115
dir=settings.SCRATCH_DIR,
suffix="-compressed-archive",
delete=False,
@@ -1517,6 +1517,7 @@ class BulkDownloadView(GenericAPIView):
for document in Document.objects.filter(pk__in=ids):
strategy.add_document(document)
# TODO(stumpylog): Investigate using FileResponse here
with open(temp.name, "rb") as f:
response = HttpResponse(f, content_type="application/zip")
response["Content-Disposition"] = '{}; filename="{}"'.format(