diff --git a/ansible/molecule/default/verify.yml b/ansible/molecule/default/verify.yml index fde2e8905..4d7e30f4d 100644 --- a/ansible/molecule/default/verify.yml +++ b/ansible/molecule/default/verify.yml @@ -17,7 +17,7 @@ - name: generate random name and content set_fact: - content: "{{ lookup('password', '/dev/null length=64 chars=ascii_letters') }}\n" + content: "{{ lookup('password', '/dev/null length=64 chars=ascii_letters') }}" filename: "{{ lookup('password', '/dev/null length=8 chars=ascii_letters') }}" - name: check if document posting works diff --git a/src/documents/views.py b/src/documents/views.py index 7aadba36d..808ecb925 100755 --- a/src/documents/views.py +++ b/src/documents/views.py @@ -381,9 +381,9 @@ class PostDocumentView(APIView): with tempfile.NamedTemporaryFile(prefix="paperless-upload-", dir=settings.SCRATCH_DIR, + buffering=0, delete=False) as f: f.write(doc_data) - f.flush() os.utime(f.name, times=(t, t)) async_task("documents.tasks.consume_file",