Skip to content

Fix normalization of city areas and make validation rules useful for display purposes

Compare
Choose a tag to compare
@patrys patrys released this 15 Nov 15:36
· 70 commits to master since this release

Previous releases had a bug that caused city name to be used when normalizing a city area name.

Validation rules now return a unique list of choices for country_area_choices, city_choices and city_area_choices where previous version would return a list of all existing translations resulting in duplicate values where spelling was identical.

For example the province list for Canada will now result in the following country_area_choices:

[('AB', 'Alberta'),
 ('BC', 'British Columbia'),
 ('BC', 'Colombie-Britannique'),
 ('MB', 'Manitoba'),
 ('NB', 'New Brunswick'),
 ('NB', 'Nouveau-Brunswick'),
 ('NL', 'Newfoundland and Labrador'),
 ('NL', 'Terre-Neuve-et-Labrador'),
 ('NT', 'Northwest Territories'),
 ('NT', 'Territoires du Nord-Ouest'),
 ('NS', 'Nouvelle-Écosse'),
 ('NS', 'Nova Scotia'),
 ('NU', 'Nunavut'),
 ('ON', 'Ontario'),
 ('PE', 'Prince Edward Island'),
 ('PE', 'Île-du-Prince-Édouard'),
 ('QC', 'Quebec'),
 ('QC', 'Québec'),
 ('SK', 'Saskatchewan'),
 ('YT', 'Yukon')]