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