regexp is always true, check if it matches
This commit is contained in:
parent
eaab56dcc7
commit
6dc151cb50
3 changed files with 3 additions and 3 deletions
|
@ -52,7 +52,7 @@ def update_static():
|
||||||
oxjs_build = os.path.join(settings.STATIC_ROOT, 'oxjs/tools/build/build.py')
|
oxjs_build = os.path.join(settings.STATIC_ROOT, 'oxjs/tools/build/build.py')
|
||||||
if os.path.exists(oxjs_build):
|
if os.path.exists(oxjs_build):
|
||||||
print 'update oxjs'
|
print 'update oxjs'
|
||||||
os.system('%s >/dev/null' % oxjs_build)
|
os.system('%s -nogeo >/dev/null' % oxjs_build)
|
||||||
|
|
||||||
data = ''
|
data = ''
|
||||||
js = []
|
js = []
|
||||||
|
|
|
@ -87,7 +87,7 @@ class Event(models.Model):
|
||||||
value = value.replace(name.lower(), '')
|
value = value.replace(name.lower(), '')
|
||||||
for name in [self.name] + list(self.alternativeNames):
|
for name in [self.name] + list(self.alternativeNames):
|
||||||
name = name.lower()
|
name = name.lower()
|
||||||
if name in value and re.compile('((^|\s)%s([\.,;:!?\-\/\s]|$))'%name):
|
if name in value and re.compile('((^|\s)%s([\.,;:!?\-\/\s]|$))'%name).findall(value):
|
||||||
matches.append(a.id)
|
matches.append(a.id)
|
||||||
break
|
break
|
||||||
if not matches:
|
if not matches:
|
||||||
|
|
|
@ -97,7 +97,7 @@ class Place(models.Model):
|
||||||
value = value.replace(name.lower(), '')
|
value = value.replace(name.lower(), '')
|
||||||
for name in [self.name] + list(self.alternativeNames):
|
for name in [self.name] + list(self.alternativeNames):
|
||||||
name = name.lower()
|
name = name.lower()
|
||||||
if name in value and re.compile('((^|\s)%s([\.,;:!?\-\/\s]|$))'%name):
|
if name in value and re.compile('((^|\s)%s([\.,;:!?\-\/\s]|$))'%name).findall(value):
|
||||||
matches.append(a.id)
|
matches.append(a.id)
|
||||||
break
|
break
|
||||||
if not matches:
|
if not matches:
|
||||||
|
|
Loading…
Reference in a new issue