Skip to content


Subversion checkout URL

You can clone with
Download ZIP
Browse files

Fixed #5471 -- Fixed cleaning of boolean field data when it's used as…

… a hidden field. Patch from Paul Lanier.

git-svn-id: bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information...
1 parent e582777 commit 9d18227a56a2b23d065dcf73c119ec3273ed2318 @malcolmt malcolmt committed
Showing with 4 additions and 0 deletions.
  1. +4 −0 django/newforms/
4 django/newforms/
@@ -452,6 +452,10 @@ class BooleanField(Field):
def clean(self, value):
"Returns a Python boolean object."
super(BooleanField, self).clean(value)
+ # Explicitly check for the string '0', which is what as hidden field
+ # will submit for False.
+ if value == '0':
+ return False
return bool(value)
class NullBooleanField(BooleanField):

0 comments on commit 9d18227

Please sign in to comment.
Something went wrong with that request. Please try again.