Skip to content

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

Fix DeprecationWarning as-per ishirav's advice

Daniel Quinn6384c698ad1c
diff --git a/src/documents/models.py b/src/documents/models.py
index 621f20803..eb45e5470 100644
--- a/src/documents/models.py
+++ b/src/documents/models.py
@@ -135,8 +135,10 @@ class MatchingModel(models.Model):
"""
findterms = re.compile(r'"([^"]+)"|(\S+)').findall
normspace = re.compile(r"\s+").sub
- return [normspace(r"\s+", (t[0] or t[1]).strip())
- for t in findterms(self.match)]
+ return [
+ normspace(" ", (t[0] or t[1]).strip()).replace(" ", r"\s+")
+ for t in findterms(self.match)
+ ]
def save(self, *args, **kwargs):