Fix checking of boolean states

This commit is contained in:
Florian Bruhin 2014-04-10 12:22:22 +02:00
parent 32ce8e6772
commit 33aa8bfa52

View File

@ -181,10 +181,10 @@ class Bool(BaseType):
'0': False, 'no': False, 'false': False, 'off': False} '0': False, 'no': False, 'false': False, 'off': False}
def transform(self, value): def transform(self, value):
return self._BOOLEAN_STATES[value.lower()] return Bool._BOOLEAN_STATES[value.lower()]
def validate(self, value): def validate(self, value):
if value.lower() not in self._BOOLEAN_STATES: if value.lower() not in Bool._BOOLEAN_STATES:
raise ValidationError(value, "must be a boolean!") raise ValidationError(value, "must be a boolean!")