[openaddresses] adding postal code country phrases in OpenAddresses as well

This commit is contained in:
Al
2017-02-11 01:48:54 -05:00
parent f6bea5ebe5
commit c9ade4a7da

View File

@@ -422,6 +422,9 @@ class OpenAddressesFormatter(object):
postcode = components.get(AddressFormatter.POSTCODE, None)
if postcode:
components[AddressFormatter.POSTCODE] = PostalCodes.add_country_phrase(postcode, country)
# If there's a postcode, we can still use just the city/state/postcode, otherwise discard
if (not street and street_required and not house_number) or (street and house_number and (street.lower() == house_number.lower())) or (unit and street and street.lower() == unit.lower()):
if not postcode: