Django

Code

Ticket #6291 (closed: fixed)

Opened 8 months ago

Last modified 8 months ago

CASocialInsuranceNumberField documentation error

Reported by: jeff+django@ivany.org Assigned to: nobody
Milestone: Component: django.contrib.localflavor
Version: SVN Keywords: localflavor, ca
Cc: Triage Stage: Ready for checkin
Has patch: 1 Needs documentation: 0
Needs tests: 0 Patch needs improvement: 0

Description

Minor documentation error on CASocialInsuranceNumberField:

"A form field that validates input as a Canadian Social Insurance Number (SIN). A valid number must have the format XXX-XXX-XXXX and pass a Luhn mod-10 checksum."

Canadian SIN is a 9 digit number, not a 10 digit as suggested in the documentation.

Also noted that the default_error_messages text has the same mistake.

Attachments

6291.diff (1.4 kB) - added by arien on 12/31/07 03:50:22.

Change History

12/31/07 03:50:22 changed by arien

  • attachment 6291.diff added.

12/31/07 03:56:58 changed by arien

  • needs_better_patch changed.
  • has_patch set to 1.
  • stage changed from Unreviewed to Ready for checkin.
  • needs_tests changed.
  • needs_docs changed.

(http://www.hrsdc.gc.ca/en/gateways/nav/top_nav/program/sin.shtml confirms the SIN is 9 digits in length.)

The attached patch fixes the docs, a comment in the code and the default error message; the regex used to validate a SIN is correct as it is.

12/31/07 04:51:18 changed by ubernostrum

  • stage changed from Ready for checkin to Unreviewed.

12/31/07 04:55:19 changed by ubernostrum

(don't mark your own tickets "ready for checkin"; that's the job of a triager or committer)

12/31/07 05:38:57 changed by arien

  • stage changed from Unreviewed to Accepted.

It's not "my" ticket. (I didn't report it.) I did submit the patch when triaging, though.

The reason I promoted straight to "ready for checkin" instead of leaving it as "accepted" (as I normally would have done) is that the issue is factual and easily verifiable (hence the link to a Canadian government site confirming the issue), and moreover the patch is trivial. I thought that would be okay in this case.

I'll move to "accepted" and leave it to somebody else to mark as "ready for checkin" if they feel that is the case.

12/31/07 15:24:49 changed by SmileyChris

  • stage changed from Accepted to Ready for checkin.

01/01/08 23:22:48 changed by adrian

Note that the patch is technically not ready for checkin, because it breaks the tests in tests/regressiontests/forms/localflavor/ca.py. I will fix this on my own, but in the future we should make sure the tests pass before marking something as "Ready for checkin."

01/01/08 23:23:21 changed by adrian

  • status changed from new to closed.
  • resolution set to fixed.

(In [6985]) Fixed #6291 -- Fixed error in CASocialInsuranceNumberField documentation and error message. Thanks, jeff+django@ivany.org and arien

01/02/08 12:52:52 changed by SmileyChris

Apologies Adrian, I really should have checked that. I promise to be a bit less promote-happy :)


Add/Change #6291 (CASocialInsuranceNumberField documentation error)




Change Properties
Action