From d158751d9234aa8768edaa27950a7f0e63b46499 Mon Sep 17 00:00:00 2001 From: Al Date: Mon, 12 Dec 2016 05:31:32 -0500 Subject: [PATCH] [addresses] same rules for state_district apply to state, no alt_names etc. unless a city is present --- scripts/geodata/addresses/components.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/geodata/addresses/components.py b/scripts/geodata/addresses/components.py index 94c9f707..03500b71 100644 --- a/scripts/geodata/addresses/components.py +++ b/scripts/geodata/addresses/components.py @@ -854,7 +854,7 @@ class AddressComponents(object): seen = set() for component_value in components_values: - if random_key and not (component == AddressFormatter.STATE_DISTRICT and not have_city): + if random_key and not (component in (AddressFormatter.STATE_DISTRICT, AddressFormatter.STATE) and not have_city): key, raw_key = self.pick_random_name_key(component_value, component, suffix=language_suffix) else: key, raw_key = name_key, raw_name_key