[fix] None case for names
This commit is contained in:
@@ -676,12 +676,12 @@ class AddressComponents(object):
|
||||
|
||||
for k in (key, name_key, raw_key, raw_name_key):
|
||||
name = component_value.get(k)
|
||||
if six.u(';') in name:
|
||||
name = random.choice(name.split(six.u(';'))).strip()
|
||||
elif six.u(',') in name:
|
||||
name = name.split(six.u(','), 1)[0].strip()
|
||||
|
||||
if name and not (name == existing_city_name and component != AddressFormatter.CITY and drop_duplicate_city_names):
|
||||
if six.u(';') in name:
|
||||
name = random.choice(name.split(six.u(';'))).strip()
|
||||
elif six.u(',') in name:
|
||||
name = name.split(six.u(','), 1)[0].strip()
|
||||
break
|
||||
# if we've checked all keys without finding a valid name, leave this component out
|
||||
else:
|
||||
|
||||
Reference in New Issue
Block a user