Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Invalid canadian postal codes #178

Closed
aarana-ix opened this issue Feb 24, 2015 · 2 comments · Fixed by #183
Closed

Invalid canadian postal codes #178

aarana-ix opened this issue Feb 24, 2015 · 2 comments · Fixed by #183

Comments

@aarana-ix
Copy link

The logic used to generate canadian zipcodes is wrong. The current format mask is this: '?#? #?#'. However, not all letters are valid in all the positions, so calling bothify on that may return invalid postal codes.

Valid canadian postal codes should match this regexp: /^[A-CEGHJK-NPR-TVXY][0-9][A-CEGHJK-NPR-TV-Z] [0-9][A-CEGHJK-NPR-TV-Z][0-9]$/

If you wish, I will fork this repo and implement the necessary changes. I just wanted to open the issue to see if something like this would be merged, and to link the PR back to the issue for discussion.

@hmaack
Copy link
Member

hmaack commented Feb 27, 2015

Hopefully @steveclarke knows more, he made the first implementation. 👍
It would be great if you could create a fix-branch and a PR if the postal codes are wrong generated. 🎁

@marocchino
Copy link
Member

I will take this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants