Fix checking of boolean states
This commit is contained in:
parent
32ce8e6772
commit
33aa8bfa52
@ -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!")
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user