From 1b0233418b037c084895d3beb795b30f609d4689 Mon Sep 17 00:00:00 2001 From: Jonas Winkler Date: Wed, 18 Nov 2020 11:32:48 +0100 Subject: [PATCH] bugfix --- src/documents/forms.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/documents/forms.py b/src/documents/forms.py index 912fd9673..38a95a068 100644 --- a/src/documents/forms.py +++ b/src/documents/forms.py @@ -32,6 +32,9 @@ class UploadForm(forms.Form): t = int(mktime(datetime.now().timetuple())) + os.makedirs(settings.SCRATCH_DIR, exist_ok=True) + + # TODO: dont just append pdf. This is here for taht weird regex check at the start of the consumer. with tempfile.NamedTemporaryFile(prefix="paperless-upload-", suffix=".pdf", dir=settings.SCRATCH_DIR, delete=False) as f: f.write(document)