]> git.ipfire.org Git - thirdparty/paperless-ngx.git/commitdiff
Be sure the scratch directory exists before using it as temporary directory
authorTrenton H <797416+stumpylog@users.noreply.github.com>
Tue, 28 Feb 2023 16:20:40 +0000 (08:20 -0800)
committerTrenton H <797416+stumpylog@users.noreply.github.com>
Wed, 1 Mar 2023 15:13:31 +0000 (07:13 -0800)
src/documents/management/commands/document_exporter.py

index fdea8aff64a0fafdf9da0d52ee7e91b235074848..427cd4ef2d7ccb61232d3d9f8a0c8fe100ac46a0 100644 (file)
@@ -156,11 +156,13 @@ class Command(BaseCommand):
         zip_export: bool = options["zip"]
 
         # If zipping, save the original target for later and
-        # get a temporary directory for the target
+        # get a temporary directory for the target instead
         temp_dir = None
         original_target = None
         if zip_export:
             original_target = self.target
+
+            os.makedirs(settings.SCRATCH_DIR, exist_ok=True)
             temp_dir = tempfile.TemporaryDirectory(
                 dir=settings.SCRATCH_DIR,
                 prefix="paperless-export",