Opened 15 years ago
Closed 14 years ago
#11577 closed Bug (fixed)
PLNIPField validation error when empty
Reported by: | amz | Owned by: | nobody |
---|---|---|---|
Component: | contrib.localflavor | Version: | 1.0 |
Severity: | Normal | Keywords: | |
Cc: | Triage Stage: | Accepted | |
Has patch: | yes | Needs documentation: | no |
Needs tests: | yes | Patch needs improvement: | yes |
Easy pickings: | no | UI/UX: | no |
Description
PLNIPField from [source:django/trunk/django/contrib/localflavor/pl/forms.py] doesn't validate when not required:
Exception Type: IndexError Exception Value: string index out of range Exception Location: /usr/lib/python2.5/site-packages/django/contrib/localflavor/pl/forms.py in has_valid_checksum, line 96
Re create:
class Client(models.Model): name = models.CharField(max_length=200, blank=True) nip = models.CharField(max_length=13, blank=True) class ClientForm(forms.ModelForm): nip = PLNIPField(required=False)
Suggestion: Don't validate if submited date is empty (patch attached)
Attachments (1)
Change History (8)
by , 15 years ago
Attachment: | plnipfield.patch added |
---|
comment:1 by , 15 years ago
milestone: | 1.0.3 |
---|
comment:2 by , 15 years ago
Triage Stage: | Unreviewed → Accepted |
---|
comment:3 by , 14 years ago
This ticket is sitting for over a year, maybe it will be good to accept it? ;)
follow-up: 5 comment:4 by , 14 years ago
Ding dong, someone is really (try to) using it. Can you accept this ticket?
comment:5 by , 14 years ago
Needs tests: | set |
---|---|
Patch needs improvement: | set |
Replying to anonymous:
Ding dong, someone is really (try to) using it. Can you accept this ticket?
It is accepted, but not ready for inclusion. First, it needs tests. Second, it doesn't fix the problem entirely. A string like "---" will pass the length check, then get stripped and an empty string will be passed to has_checksum_valid.
comment:6 by , 14 years ago
Severity: | → Normal |
---|---|
Type: | → Bug |
comment:7 by , 14 years ago
Easy pickings: | unset |
---|---|
Resolution: | → fixed |
Status: | new → closed |
Apparently fixed by changeset:14949
Not a 1.0.3 ticket.