STATES_NORMALIZED dict for India does not include all states
|Reported by:||jsdalton||Owned by:||nobody|
|Cc:||jsdalton||Triage Stage:||Ready for checkin|
|Has patch:||yes||Needs documentation:||no|
|Needs tests:||no||Patch needs improvement:||no|
I got bit today by an inconsitency in the implementation of the STATES_NORMALIZED dictionary for India as compared with the U.S. and Canada. (These are the only three countries which offer this dictionary.
My assumption is that the purpose of this dictionary is to help normalize user input to the correct two letter state abbreviation. For both the U.S. and Canada, this dictionary maps every two-letter abbreviation to the normalized version (e.g.. "bc" -> "BC"), every complete spelling to the normalized version (e.g. "british columbia" -> "BC") and common misspellings or abbreviations to the normalized version (e.g. "calif" -> "CA"). Makes sense.
The STATES_NORMALIZED dict in India does not do this though. It *only* maps a handful of abbreviations and misspellings, but does not comprehensively map each two letter abbreviation and each state.
I implemented some logic that assumed it worked like the U.S. and Canada and got a complaint from a user registering from Gujarat who could not do so, because no mapping is included for it. Yikes!
I humbly propose we extend STATES_NORMALIZED for India with all two letter abbreviations and spelled out state names. If there is a reason not to do this, I'd like to hear it. Otherwise, my patch is attached.
Change History (18)
comment:1 Changed 5 years ago by julien
- Has patch set
- Needs documentation unset
- Needs tests set
- Patch needs improvement unset
- Triage Stage changed from Unreviewed to Accepted