regexp is always true, check if it matches

This commit is contained in:
j 2011-10-30 23:43:41 +01:00
parent eaab56dcc7
commit 6dc151cb50
3 changed files with 3 additions and 3 deletions

View file

@ -52,7 +52,7 @@ def update_static():
oxjs_build = os.path.join(settings.STATIC_ROOT, 'oxjs/tools/build/build.py')
if os.path.exists(oxjs_build):
print 'update oxjs'
os.system('%s >/dev/null' % oxjs_build)
os.system('%s -nogeo >/dev/null' % oxjs_build)
data = ''
js = []

View file

@ -87,7 +87,7 @@ class Event(models.Model):
value = value.replace(name.lower(), '')
for name in [self.name] + list(self.alternativeNames):
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)
break
if not matches:

View file

@ -97,7 +97,7 @@ class Place(models.Model):
value = value.replace(name.lower(), '')
for name in [self.name] + list(self.alternativeNames):
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)
break
if not matches: