Skip to content

A community-supported supercharged document management system: scan, index and archive all your documents

Warn if consume directory contains subdirectories

Johann Bauer22c7f309a76d
diff --git a/src/documents/consumer.py b/src/documents/consumer.py
index 3cb484b2a..4e9f17116 100644
--- a/src/documents/consumer.py
+++ b/src/documents/consumer.py
@@ -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
diff --git a/src/documents/management/commands/document_consumer.py b/src/documents/management/commands/document_consumer.py
index 6f731372f..8a6ccfcdd 100644
--- a/src/documents/management/commands/document_consumer.py
+++ b/src/documents/management/commands/document_consumer.py
@@ -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