Skip to content

Commit

Permalink
[#2939] Fix for boolean validator if bool is passed
Browse files Browse the repository at this point in the history
  • Loading branch information
tobes committed Oct 3, 2012
1 parent 6cb7c1d commit c8415c5
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions ckan/logic/validators.py
Expand Up @@ -32,6 +32,8 @@ def int_validator(value, context):
raise Invalid(_('Invalid integer'))

def boolean_validator(value, context):
if isinstance(value, bool):
return value
if value.lower() in ['true', 'yes', 't', 'y', '1']:
return True
return False
Expand Down

0 comments on commit c8415c5

Please sign in to comment.