Skip to content

A community-supported supercharged document management system: scan, index and archive all your documents

Fix matching if user supplied an empty value

Pit Kleyersburg7b227ffa2f36
diff --git a/src/documents/models.py b/src/documents/models.py
index 478fac1b2..26acb95d7 100644
--- a/src/documents/models.py
+++ b/src/documents/models.py
@@ -86,6 +86,9 @@ class Tag(SluggedModel):
self.name, self.match, self.get_matching_algorithm_display())
def matches(self, text):
+ # Check that match is not empty
+ if self.match.strip() == "":
+ return False
if self.matching_algorithm == self.MATCH_ALL:
for word in self.match.split(" "):