Skip to content
Browse files

Modified BooleanField's to_python method to play nice with encode()ed…

… strings.

git-svn-id: bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information...
1 parent 59bf8dd commit ab4ffe5d78c9eb9cab1a15828dddf3c5f010ad2a @freakboy3742 freakboy3742 committed
Showing with 2 additions and 2 deletions.
  1. +2 −2 django/db/models/fields/
4 django/db/models/fields/
@@ -364,8 +364,8 @@ def __init__(self, *args, **kwargs):
def to_python(self, value):
if value in (True, False): return value
- if value is 't' or value is 'True': return True
- if value is 'f' or value is 'False': return False
+ if value in ('t', 'True'): return True
+ if value in ('f', 'False'): return False
raise validators.ValidationError, gettext("This value must be either True or False.")
def get_manipulator_field_objs(self):

0 comments on commit ab4ffe5

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