From 416101d557797517da202c405ca6b4b99f9e9955 Mon Sep 17 00:00:00 2001 From: jonaswinkler Date: Mon, 15 Feb 2021 11:52:46 +0100 Subject: [PATCH] only import dateparser when required --- src/documents/parsers.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/documents/parsers.py b/src/documents/parsers.py index 1ed5deb3c..b2714f6a3 100644 --- a/src/documents/parsers.py +++ b/src/documents/parsers.py @@ -6,7 +6,6 @@ import shutil import subprocess import tempfile -import dateparser import magic from django.conf import settings from django.utils import timezone @@ -200,6 +199,8 @@ def parse_date(filename, text): """ Call dateparser.parse with a particular date ordering """ + import dateparser + return dateparser.parse( ds, settings={