mirror of
				https://github.com/paperless-ngx/paperless-ngx.git
				synced 2025-11-03 03:16:10 -06:00 
			
		
		
		
	Fixes issue where barcode containing files wouldn't be placed into the same directory after splitting
This commit is contained in:
		@@ -87,6 +87,8 @@ def consume_file(
 | 
				
			|||||||
    override_created=None,
 | 
					    override_created=None,
 | 
				
			||||||
):
 | 
					):
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    path = Path(path).resolve()
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    # check for separators in current document
 | 
					    # check for separators in current document
 | 
				
			||||||
    if settings.CONSUMER_ENABLE_BARCODES:
 | 
					    if settings.CONSUMER_ENABLE_BARCODES:
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -122,7 +124,11 @@ def consume_file(
 | 
				
			|||||||
                        newname = f"{str(n)}_" + override_filename
 | 
					                        newname = f"{str(n)}_" + override_filename
 | 
				
			||||||
                    else:
 | 
					                    else:
 | 
				
			||||||
                        newname = None
 | 
					                        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
 | 
					                # if we got here, the document was successfully split
 | 
				
			||||||
                # and can safely be deleted
 | 
					                # and can safely be deleted
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user