]> git.ipfire.org Git - thirdparty/paperless-ngx.git/commitdiff
Fixes issue where barcode containing files wouldn't be placed into the same directory... 1303/head
authorTrenton Holmes <holmes.trenton@gmail.com>
Fri, 29 Jul 2022 17:22:54 +0000 (10:22 -0700)
committerTrenton Holmes <holmes.trenton@gmail.com>
Fri, 29 Jul 2022 17:22:54 +0000 (10:22 -0700)
src/documents/tasks.py

index 0390129e2338ca4f0a464ec5db3810367795fcf1..35404587d43c041012ebbc0695c20e8fffd90b64 100644 (file)
@@ -87,6 +87,8 @@ def consume_file(
     override_created=None,
 ):
 
+    path = Path(path).resolve()
+
     # check for separators in current document
     if settings.CONSUMER_ENABLE_BARCODES:
 
@@ -122,7 +124,11 @@ def consume_file(
                         newname = f"{str(n)}_" + override_filename
                     else:
                         newname = None
-                    barcodes.save_to_dir(document, newname=newname)
+                    barcodes.save_to_dir(
+                        document,
+                        newname=newname,
+                        target_dir=path.parent,
+                    )
 
                 # if we got here, the document was successfully split
                 # and can safely be deleted