From e2c574bd3118bcbf1410fe5ee49b840ac57470ec Mon Sep 17 00:00:00 2001 From: David Rousselie Date: Thu, 26 Oct 2006 19:48:34 +0200 Subject: [PATCH] Boolean field correctly handled Boolean can be "1"/"0" or "true"/"false" darcs-hash:20061026174834-86b55-334f07b0c4765e7f3395159edcc7702a613ec877.gz --- src/jmc/jabber/component.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/jmc/jabber/component.py b/src/jmc/jabber/component.py index 4de02cf..58d4b02 100644 --- a/src/jmc/jabber/component.py +++ b/src/jmc/jabber/component.py @@ -574,7 +574,8 @@ class MailComponent(Component): password = None store_password = x.fields.has_key("store_password") \ - and (x.fields["store_password"].value == "1") + and (x.fields["store_password"].value == "1" + or x.fields["store_password"].value.lower() == "true") if x.fields.has_key("host"): host = x.fields["host"].value @@ -632,7 +633,8 @@ class MailComponent(Component): interval = None live_email_only = x.fields.has_key("live_email_only") \ - and (x.fields["live_email_only"].value == "1") + and (x.fields["live_email_only"].value == "1" + or x.fields["live_email_only"].value == "true") self.__logger.debug(u"New Account: %s, %s, %s, %s, %s, %s, %s, %s %i %i %i %i %i %i %i %s" \ % (name, login, password, str(store_password), host, str(port), \