mirror of
				https://github.com/paperless-ngx/paperless-ngx.git
				synced 2025-11-03 03:16:10 -06:00 
			
		
		
		
	Warn if consume directory contains subdirectories
.
This commit is contained in:
		@@ -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
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user