#8676: BooleanField says value required if False
---------------------------+------------------------------------------------
 Reporter:  dobee          |       Owner:  nobody    
   Status:  new            |   Milestone:            
Component:  Uncategorized  |     Version:  SVN       
 Keywords:  forms          |       Stage:  Unreviewed
Has_patch:  1              |  
---------------------------+------------------------------------------------
 The BooleanField should accept False values and not raise the required
 error. Here is a diff from the
 http://code.djangoproject.com/svn/django/tags/notable_moments/1.0-beta-1
 branch. The problem is in trunk too.

 {{{
 Index: django/forms/fields.py
 ===================================================================
 --- django/forms/fields.py      (revision 8696)
 +++ django/forms/fields.py      (working copy)
 @@ -569,9 +569,9 @@
          if value == 'False':
              value = False
          else:
 -            value = bool(value)
 +            value = value and True or None
          super(BooleanField, self).clean(value)
 -        if not value and self.required:
 +        if value is None and self.required:
              raise ValidationError(self.error_messages['required'])
          return value

 }}}

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