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

svn: r21913
This commit is contained in:
Nick Hall 2013-04-06 17:27:26 +00:00
parent c5fe6ed881
commit cb028cea56

View File

@ -36,6 +36,7 @@ _ = glocale.get_translation().gettext
# #
#------------------------------------------------------------------------- #-------------------------------------------------------------------------
from .. import Rule from .. import Rule
from ....lib import Location
#------------------------------------------------------------------------- #-------------------------------------------------------------------------
# #
@ -77,9 +78,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