mirror of
https://github.com/paperless-ngx/paperless-ngx.git
synced 2025-12-16 11:36:39 +01:00
Merge pull request #621 from languitar/fix-620
Handle dateparse exceptions for invalid date formats
This commit is contained in:
commit
cc31fc14a3
2 changed files with 20 additions and 4 deletions
|
|
@ -108,7 +108,7 @@ class DocumentParser:
|
|||
|
||||
try:
|
||||
date = __parser(date_string, self.FILENAME_DATE_ORDER)
|
||||
except TypeError:
|
||||
except (TypeError, ValueError):
|
||||
# Skip all matches that do not parse to a proper date
|
||||
continue
|
||||
|
||||
|
|
@ -134,7 +134,7 @@ class DocumentParser:
|
|||
|
||||
try:
|
||||
date = __parser(date_string, self.DATE_ORDER)
|
||||
except TypeError:
|
||||
except (TypeError, ValueError):
|
||||
# Skip all matches that do not parse to a proper date
|
||||
continue
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue