From 2aea220c6d76ad8109f43f6065f50786ddce4607 Mon Sep 17 00:00:00 2001 From: Trenton H <797416+stumpylog@users.noreply.github.com> Date: Sun, 28 Jan 2024 09:07:04 -0800 Subject: [PATCH] Ensure the scratch directory exists before consuming this source (#5579) --- src/documents/management/commands/document_consumer.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/documents/management/commands/document_consumer.py b/src/documents/management/commands/document_consumer.py index 16bcf9bd9..919530544 100644 --- a/src/documents/management/commands/document_consumer.py +++ b/src/documents/management/commands/document_consumer.py @@ -232,6 +232,9 @@ class Command(BaseCommand): if not os.path.isdir(directory): raise CommandError(f"Consumption directory {directory} does not exist") + # Consumer will need this + settings.SCRATCH_DIR.mkdir(parents=True, exist_ok=True) + if recursive: for dirpath, _, filenames in os.walk(directory): for filename in filenames: