mirror of
				https://github.com/paperless-ngx/paperless-ngx.git
				synced 2025-11-04 03:27:12 -05:00 
			
		
		
		
	Warn if consume directory contains subdirectories
.
This commit is contained in:
		
							parent
							
								
									a690b1cf24
								
							
						
					
					
						commit
						22c7f309a7
					
				@ -94,6 +94,11 @@ class Consumer:
 | 
			
		||||
                    ignored_files.append(file)
 | 
			
		||||
                else:
 | 
			
		||||
                    files.append(file)
 | 
			
		||||
            else:
 | 
			
		||||
                self.logger.warning(
 | 
			
		||||
                    "Skipping %s as it is not a file",
 | 
			
		||||
                    entry.path
 | 
			
		||||
                )
 | 
			
		||||
 | 
			
		||||
        if not files:
 | 
			
		||||
            return
 | 
			
		||||
 | 
			
		||||
@ -26,6 +26,7 @@ class Command(BaseCommand):
 | 
			
		||||
    def __init__(self, *args, **kwargs):
 | 
			
		||||
 | 
			
		||||
        self.verbosity = 0
 | 
			
		||||
        self.logger = logging.getLogger(__name__)
 | 
			
		||||
 | 
			
		||||
        self.file_consumer = None
 | 
			
		||||
        self.mail_fetcher = None
 | 
			
		||||
@ -138,6 +139,11 @@ class Command(BaseCommand):
 | 
			
		||||
                        file = os.path.join(directory, event.name)
 | 
			
		||||
                        if os.path.isfile(file):
 | 
			
		||||
                            self.file_consumer.try_consume_file(file)
 | 
			
		||||
                        else:
 | 
			
		||||
                            self.logger.warning(
 | 
			
		||||
                                "Skipping %s as it is not a file",
 | 
			
		||||
                                file
 | 
			
		||||
                            )
 | 
			
		||||
                else:
 | 
			
		||||
                    break
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user