#11577: PLNIPField validation error when empty
----------------------------------------+-----------------------------------
 Reporter:  amz                         |       Owner:  nobody    
   Status:  new                         |   Milestone:  1.0.3     
Component:  django.contrib.localflavor  |     Version:  1.0       
 Keywords:                              |       Stage:  Unreviewed
Has_patch:  1                           |  
----------------------------------------+-----------------------------------
 ''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:

 {{{
 #!python
 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)
 ----

-- 
Ticket URL: <http://code.djangoproject.com/ticket/11577>
Django <http://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to