From 7106c68032077f9b98a1295505139d1bd13614b7 Mon Sep 17 00:00:00 2001 From: Daniel Breitlauch Date: Fri, 1 Apr 2022 12:03:05 +0200 Subject: [PATCH] FIX BUG: case-sensitive matching was not possible --- src/documents/matching.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/documents/matching.py b/src/documents/matching.py index 425674d8d..523ee028e 100644 --- a/src/documents/matching.py +++ b/src/documents/matching.py @@ -60,14 +60,15 @@ def match_tags(document, classifier): def matches(matching_model, document): search_kwargs = {} - document_content = document.content.lower() - # Check that match is not empty if matching_model.match.strip() == "": return False if matching_model.is_insensitive: search_kwargs = {"flags": re.IGNORECASE} + document_content = document.content.lower() + else: + document_content = document.content if matching_model.matching_algorithm == MatchingModel.MATCH_ALL: for word in _split_match(matching_model):