mirror of
https://github.com/paperless-ngx/paperless-ngx.git
synced 2025-04-09 09:58:20 -05:00
Merge pull request #1998 from paperless-ngx/fix/1993-date-overflow
Bugfix: Don't allow exceptions during date parsing to fail consume
This commit is contained in:
commit
27f7f0a941
@ -459,7 +459,12 @@ class Consumer(LoggingMixin):
|
|||||||
|
|
||||||
return document
|
return document
|
||||||
|
|
||||||
def _store(self, text, date, mime_type) -> Document:
|
def _store(
|
||||||
|
self,
|
||||||
|
text: str,
|
||||||
|
date: Optional[datetime.datetime],
|
||||||
|
mime_type: str,
|
||||||
|
) -> Document:
|
||||||
|
|
||||||
# If someone gave us the original filename, use it instead of doc.
|
# If someone gave us the original filename, use it instead of doc.
|
||||||
|
|
||||||
|
@ -260,7 +260,7 @@ def parse_date_generator(filename, text) -> Iterator[datetime.datetime]:
|
|||||||
|
|
||||||
try:
|
try:
|
||||||
date = __parser(date_string, date_order)
|
date = __parser(date_string, date_order)
|
||||||
except (TypeError, ValueError):
|
except Exception:
|
||||||
# Skip all matches that do not parse to a proper date
|
# Skip all matches that do not parse to a proper date
|
||||||
date = None
|
date = None
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user