mirror of
				https://github.com/paperless-ngx/paperless-ngx.git
				synced 2025-10-30 03:56:23 -05:00 
			
		
		
		
	If the original file containing a barcode was in the temporary scratch dir, move the split files to consume dir
This commit is contained in:
		 Trenton Holmes
					Trenton Holmes
				
			
				
					committed by
					
						 Trenton H
						Trenton H
					
				
			
			
				
	
			
			
			 Trenton H
						Trenton H
					
				
			
						parent
						
							462b243531
						
					
				
				
					commit
					9aefff38e7
				
			| @@ -112,10 +112,20 @@ def consume_file( | |||||||
|                         newname = f"{str(n)}_" + override_filename |                         newname = f"{str(n)}_" + override_filename | ||||||
|                     else: |                     else: | ||||||
|                         newname = None |                         newname = None | ||||||
|  |  | ||||||
|  |                     # If the file is an upload, it's in the scratch directory | ||||||
|  |                     # Move it to consume directory to be picked up | ||||||
|  |                     # Otherwise, use the current parent to keep possible tags | ||||||
|  |                     # from subdirectories | ||||||
|  |                     if path.is_relative_to(settings.SCRATCH_DIR): | ||||||
|  |                         save_to_dir = settings.CONSUMPTION_DIR | ||||||
|  |                     else: | ||||||
|  |                         save_to_dir = path.parent | ||||||
|  |  | ||||||
|                     barcodes.save_to_dir( |                     barcodes.save_to_dir( | ||||||
|                         document, |                         document, | ||||||
|                         newname=newname, |                         newname=newname, | ||||||
|                         target_dir=path.parent, |                         target_dir=save_to_dir, | ||||||
|                     ) |                     ) | ||||||
|  |  | ||||||
|                 # Delete the PDF file which was split |                 # Delete the PDF file which was split | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user