PL localflavor field PLNIPfield allows improper values
|Reported by:||jbl1||Owned by:||nobody|
|Has patch:||no||Needs documentation:||no|
|Needs tests:||no||Patch needs improvement:||no|
One such value is "1112025170":
>>> from django.contrib.localflavor.pl import forms >>> form = forms.PLNIPField() >>> bool(form.has_valid_checksum("1112025170")) True
whereas it is not a valid NIP (tax id number) as the checksum for it is equal 10. All such numbers are not valid formally.
Attaching the simplest possible patch.
Change History (4)
Changed 5 years ago by jbl1
comment:1 Changed 5 years ago by claudep
- Needs documentation unset
- Needs tests set
- Patch needs improvement unset
- Triage Stage changed from Unreviewed to Accepted