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

Fix French national identification number validation with people born overseas #415

Merged
merged 3 commits into from
Apr 19, 2020

Conversation

leo-naeka
Copy link
Contributor

I realized that localflavor does not allow the entry of NIR with 98 as the birth department, excluding it because 98 would correspond to Monaco.

In fact, 98 is used for "COM" (eg. French Polynesia, Wallis and Futuna, New Caledonia) and people born in Monaco would have 99 as department_of_origin and 138 as commune_of_origin (99 stands for a birth abroad and 138 is the INSEE code for Monaco).

This codification is a real mess, I've attached two official INSEE documents, which are more complete and reliable sources than Wikipedia (page 6 is a good summary).

This fix add the following changes:

  • Remove "Monaco's" invalidation
  • Increase DOM dept range ([971-976] -> [971-978])
  • Support COM numbers (dept range within [984-989])
  • Add info for foreign cases (dept is 99)
  • Add according tests

INSEE Guide identification.pdf
INSEE Codes Pays.pdf

@benkonrath
Copy link
Member

It looks good, thanks!

Just two small remarks:

  • It would be nice if you could include links to the PDFs that you attached. It's nice that they're attached on this issue but links to the reference documents in the code help make them a little more discoverable.

  • You're welcome to add your name to the authors file although this is optional.

I can merge this as soon as the links are added if that's possible. Thanks.

@leo-naeka
Copy link
Contributor Author

  • It would be nice if you could include links to the PDFs that you attached. It's nice that they're attached on this issue but links to the reference documents in the code help make them a little more discoverable.

@benkonrath I had those documents for some time, grabbed from an administrative site but can't find their links anymore (and we definitively should not rely on these sites to preserve access over time), so I've put them on Scribd.

Ok for me to merge like this, let me know if you prefer these commits squashed.

@benkonrath benkonrath merged commit 5a071d4 into django:master Apr 19, 2020
@benkonrath
Copy link
Member

Thanks, I rebased and squashed the commits on merge (it's easy to do directly in github these days).

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 this pull request may close these issues.

2 participants