Fix DeprecationWarning as-per ishirav's advice

This commit is contained in:
Daniel Quinn 2018-02-03 14:48:14 +00:00
parent abf01be889
commit 6384c698ad

@ -135,8 +135,10 @@ class MatchingModel(models.Model):
""" """
findterms = re.compile(r'"([^"]+)"|(\S+)').findall findterms = re.compile(r'"([^"]+)"|(\S+)').findall
normspace = re.compile(r"\s+").sub normspace = re.compile(r"\s+").sub
return [normspace(r"\s+", (t[0] or t[1]).strip()) return [
for t in findterms(self.match)] normspace(" ", (t[0] or t[1]).strip()).replace(" ", r"\s+")
for t in findterms(self.match)
]
def save(self, *args, **kwargs): def save(self, *args, **kwargs):