Opened 6 years ago

Closed 6 years ago

Last modified 6 years ago

#15175 closed (fixed)

bug when validate chilean national identification number

Reported by: rvimer Owned by: ersame
Component: contrib.localflavor Version: master
Severity: Keywords: localflavor
Cc: Triage Stage: Ready for checkin
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: UI/UX:

Description

Bug when validate chilean national identification number with verifier digit lower case ('k').
Steps to reproduce the bug

>>> from django.contrib.localflavor.cl.forms import CLRutField
>>> rut = CLRutField()
>>> rut.clean('13449333-k')
Traceback (most recent call last):
 File "<console>", line 1, in <module>
 File "/home/rene/backup/programFiles/django/trunk/django/contrib/localflavor/cl/forms.py", line 56, in clean
   raise ValidationError(self.error_messages['checksum'])
ValidationError: [u'The Chilean RUT is not valid.']
>>> rut.clean('13449333-K')
u'13.449.333-K'
>>>

Attachments (3)

form.patch (202 bytes) - added by rvimer 6 years ago.
Patch form.py
localflavour_cl_form.diff (1.0 KB) - added by ersame 6 years ago.
localflavour_cl_form_2.diff (1020 bytes) - added by Brandon M Height 6 years ago.

Download all attachments as: .zip

Change History (9)

Changed 6 years ago by rvimer

Attachment: form.patch added

Patch form.py

comment:1 Changed 6 years ago by Russell Keith-Magee

Needs tests: set
Patch needs improvement: set
Triage Stage: UnreviewedAccepted

Changed 6 years ago by ersame

Attachment: localflavour_cl_form.diff added

comment:2 Changed 6 years ago by ersame

Needs tests: unset
Owner: changed from nobody to ersame
Patch needs improvement: unset
Status: newassigned

Hi,

This is my first patch and my hello to django developper.

It's an easy ticket and I would like to know if I have done it well.

Regards.

comment:3 Changed 6 years ago by Russell Keith-Magee

Triage Stage: AcceptedReady for checkin

Changed 6 years ago by Brandon M Height

Attachment: localflavour_cl_form_2.diff added

comment:4 Changed 6 years ago by Brandon M Height

Modified ersames' patch. I didn't really see the need for the additional line declaring 'verifier' as a variable.

comment:5 Changed 6 years ago by Russell Keith-Magee

Resolution: fixed
Status: assignedclosed

In [15450]:

Fixed #15175 -- Ensured that Chliean RUT checksum letters aren't case sensitive. Thanks to rvimer for the report, and to ersame for the patch.

H: Enter commit message. Lines beginning with 'HG:' are removed.

comment:6 Changed 6 years ago by Russell Keith-Magee

In [15454]:

[1.2.X] Fixed #15175 -- Ensured that Chliean RUT checksum letters aren't case sensitive. Thanks to rvimer for the report, and to ersame for the patch.

H: Enter commit message. Lines beginning with 'HG:' are removed.

Backport of r15450 from trunk.

Note: See TracTickets for help on using tickets.
Back to Top