mirror of
https://github.com/paperless-ngx/paperless-ngx.git
synced 2025-04-02 13:45:10 -05:00
Be sure the scratch directory exists before using it as temporary directory
This commit is contained in:
parent
72efb24b73
commit
c422a081bf
@ -156,11 +156,13 @@ class Command(BaseCommand):
|
|||||||
zip_export: bool = options["zip"]
|
zip_export: bool = options["zip"]
|
||||||
|
|
||||||
# If zipping, save the original target for later and
|
# 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
|
temp_dir = None
|
||||||
original_target = None
|
original_target = None
|
||||||
if zip_export:
|
if zip_export:
|
||||||
original_target = self.target
|
original_target = self.target
|
||||||
|
|
||||||
|
os.makedirs(settings.SCRATCH_DIR, exist_ok=True)
|
||||||
temp_dir = tempfile.TemporaryDirectory(
|
temp_dir = tempfile.TemporaryDirectory(
|
||||||
dir=settings.SCRATCH_DIR,
|
dir=settings.SCRATCH_DIR,
|
||||||
prefix="paperless-export",
|
prefix="paperless-export",
|
||||||
|
Loading…
x
Reference in New Issue
Block a user