[fix] pivot keys in address formatter

This commit is contained in:
Al
2016-05-22 03:19:41 -04:00
parent 85fc61fda0
commit 3017c22dc8

View File

@@ -470,7 +470,7 @@ class AddressFormatter(object):
i = None
pivot = None
pivot_keys = (AddressFormatter.CITY, AddressFormatter.COUNTRY)
pivot_keys = (AddressFormatter.CITY, AddressFormatter.STATE, AddressFormatter.COUNTRY)
for component in pivot_keys:
token = self.tag_token(component)
@@ -480,7 +480,7 @@ class AddressFormatter(object):
break
if i is None:
raise ValueError('Template must contain one of {{{}}}'.format(','.join(pivot_keys)))
raise ValueError('Template {} does not contain one of {{{}}}'.format(country, ','.join(pivot_keys)))
prev = pivot