Opened 5 years ago

Closed 4 years ago

Last modified 4 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 5 years ago.
Patch form.py
localflavour_cl_form.diff (1.0 KB) - added by ersame 4 years ago.
localflavour_cl_form_2.diff (1020 bytes) - added by lasko 4 years ago.

Download all attachments as: .zip

Change History (9)

Changed 5 years ago by rvimer

Patch form.py

comment:1 Changed 5 years ago by russellm

  • Needs documentation unset
  • Needs tests set
  • Patch needs improvement set
  • Triage Stage changed from Unreviewed to Accepted

Changed 4 years ago by ersame

comment:2 Changed 4 years ago by ersame

  • Needs tests unset
  • Owner changed from nobody to ersame
  • Patch needs improvement unset
  • Status changed from new to assigned

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 4 years ago by russellm

  • Triage Stage changed from Accepted to Ready for checkin

Changed 4 years ago by lasko

comment:4 Changed 4 years ago by lasko

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

comment:5 Changed 4 years ago by russellm

  • Resolution set to fixed
  • Status changed from assigned to closed

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 4 years ago by russellm

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