mirror of
https://github.com/paperless-ngx/paperless-ngx.git
synced 2026-02-03 23:22:42 -06:00
Restores using OcrConfig for the moment
This commit is contained in:
@@ -10,6 +10,7 @@ from django.utils import timezone
|
||||
from documents.plugins.date_parsing.base import DateParserConfig
|
||||
from documents.plugins.date_parsing.base import DateParserPluginBase
|
||||
from documents.plugins.date_parsing.regex_parser import RegexDateParserPlugin
|
||||
from paperless.config import OcrConfig
|
||||
from paperless.utils import ocr_to_dateparser_languages
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
@@ -74,9 +75,9 @@ def get_date_parser() -> DateParserPluginBase:
|
||||
|
||||
# 2. Load configuration from settings
|
||||
# TODO: Get the language from the settings and/or configuration object, depending
|
||||
languages = languages = (
|
||||
settings.DATE_PARSER_LANGUAGES
|
||||
or ocr_to_dateparser_languages(settings.OCR_LANGUAGE)
|
||||
ocr_config = OcrConfig()
|
||||
languages = settings.DATE_PARSER_LANGUAGES or ocr_to_dateparser_languages(
|
||||
ocr_config.language,
|
||||
)
|
||||
|
||||
config = DateParserConfig(
|
||||
|
||||
@@ -191,6 +191,7 @@ class TestDiscoverParserClass:
|
||||
mock_entry_points.assert_called_once()
|
||||
|
||||
|
||||
@pytest.mark.django_db
|
||||
@pytest.mark.date_parsing
|
||||
@pytest.mark.usefixtures("mock_date_parser_settings")
|
||||
class TestGetDateParser:
|
||||
|
||||
Reference in New Issue
Block a user