#3482: MultipleChoiceField validation against a list with a single null element
------------------------------------------+---------------------------------
Reporter:  Jeff Bauer <[EMAIL PROTECTED]>  |       Owner:  adrian             
  Status:  new                            |   Component:  django.newforms    
 Version:  SVN                            |    Keywords:  MultipleChoiceField
   Stage:  Unreviewed                     |   Has_patch:  1                  
------------------------------------------+---------------------------------
 MultipleChoiceField fails validation when required=False against a list
 with a single null value (as opposed to when value itself is null)
 {{{
 >>> f = MultipleChoiceField(required=False, choices=[('1', '1'), ('2',
 '2')])
 >>> f.clean([''])
 Traceback (most recent call last):
   File "<stdin>", line 1, in ?
   File "django/newforms/fields.py", line 386, in clean
     if val not in valid_values:
 django.newforms.util.ValidationError: [u'Select a valid choice.  is not
 one of the available choices.']
 >>>
 }}}

-- 
Ticket URL: <http://code.djangoproject.com/ticket/3482>
Django Code <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