mirror of
				https://github.com/paperless-ngx/paperless-ngx.git
				synced 2025-11-03 19:17:13 -05:00 
			
		
		
		
	Fixed an ugly bug that broke all deletions
This commit is contained in:
		
							parent
							
								
									9e845ba813
								
							
						
					
					
						commit
						5662035efd
					
				@ -5,7 +5,7 @@ from subprocess import Popen
 | 
			
		||||
 | 
			
		||||
from django.conf import settings
 | 
			
		||||
 | 
			
		||||
from ..models import Correspondent, Tag
 | 
			
		||||
from ..models import Correspondent, Document, Tag
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
def logger(message, group):
 | 
			
		||||
@ -85,6 +85,10 @@ def run_post_consume_script(sender, document, **kwargs):
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
def cleanup_document_deletion(sender, instance, using, **kwargs):
 | 
			
		||||
 | 
			
		||||
    if not isinstance(instance, Document):
 | 
			
		||||
        return
 | 
			
		||||
 | 
			
		||||
    for f in (instance.source_path, instance.thumbnail_path):
 | 
			
		||||
        try:
 | 
			
		||||
            os.unlink(f)
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user