6599: Fix matching empty fields in empty locations using regular expressions

svn: r21911
This commit is contained in:
Nick Hall 2013-04-06 17:27:05 +00:00
parent 2fd1ee8520
commit 1764c1dcd2

View File

@ -35,6 +35,7 @@ from gen.ggettext import gettext as _
# #
#------------------------------------------------------------------------- #-------------------------------------------------------------------------
from Filters.Rules._Rule import Rule from Filters.Rules._Rule import Rule
from gen.lib import Location
#------------------------------------------------------------------------- #-------------------------------------------------------------------------
# #
@ -76,9 +77,9 @@ class HasPlace(Rule):
return False return False
def apply_location(self, loc): def apply_location(self, loc):
# Empty locaiton does not match anything
if not loc: if not loc:
return False # Allow regular expressions to match empty fields
loc = Location()
if not self.match_substring(1, loc.get_street()): if not self.match_substring(1, loc.get_street()):
return False return False