[openaddresses] fix Chinese house number validation

This commit is contained in:
Al
2017-01-28 02:03:19 -05:00
parent 2b349ef8a8
commit 12bc18f74b
2 changed files with 5 additions and 6 deletions

View File

@@ -150,7 +150,10 @@ class OpenAddressesFormatter(object):
if not house_number:
return False
tokens = tokenize(house_number)
return all((c in token_types.NUMERIC_TOKEN_TYPES or t in (u'', u'', u'')) for t, c in tokens)
if all((c in token_types.NUMERIC_TOKEN_TYPES or t in (u'', u'', u'')) for t, c in tokens):
return True
return cls.validate_house_number(house_number)
component_validators = {
AddressFormatter.HOUSE_NUMBER: validators.validate_house_number,
@@ -158,7 +161,6 @@ class OpenAddressesFormatter(object):
AddressFormatter.POSTCODE: validators.validate_postcode,
}
language_validators = {
SPANISH: {
AddressFormatter.HOUSE_NUMBER: validators.validate_house_number_sin_numero,