From 973f36c496b1c1f3bfdae2c5661edb935d5273ab Mon Sep 17 00:00:00 2001 From: Pavel Zuna Date: Thu, 26 Nov 2009 15:53:07 +0100 Subject: Fix Bool parameter type. It was impossible to set it to FALSE. --- ipalib/parameters.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'ipalib/parameters.py') diff --git a/ipalib/parameters.py b/ipalib/parameters.py index 8a1aede9..68264af4 100644 --- a/ipalib/parameters.py +++ b/ipalib/parameters.py @@ -799,8 +799,8 @@ class Bool(Param): # FIXME: This my quick hack to get some UI stuff working, change these defaults # --jderose 2009-08-28 kwargs = Param.kwargs + ( - ('truths', frozenset, frozenset([1, u'1', u'True'])), - ('falsehoods', frozenset, frozenset([0, u'0', u'False'])), + ('truths', frozenset, frozenset([1, u'1', u'true'])), + ('falsehoods', frozenset, frozenset([0, u'0', u'false'])), ) def _convert_scalar(self, value, index=None): @@ -809,6 +809,8 @@ class Bool(Param): """ if type(value) is self.type: return value + if isinstance(value, basestring): + value = value.lower() if value in self.truths: return True if value in self.falsehoods: -- cgit