Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/dax/jmc.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Rousselie <david.rousselie@happycoders.org>2010-06-08 21:30:59 +0400
committerDavid Rousselie <david.rousselie@happycoders.org>2010-06-08 21:30:59 +0400
commit321d5520545e68a7e396afabf89e1eaa685e6a3e (patch)
treeab6668d87daf9eec4bc924684a3e40bc9a424a6c
parent79ecfa71be945acafb6a28b4cbac12abb0138864 (diff)
handle boolean values sent in forms as strings
-rw-r--r--src/jmc/model/account.py12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/jmc/model/account.py b/src/jmc/model/account.py
index 4d3741c..10cd470 100644
--- a/src/jmc/model/account.py
+++ b/src/jmc/model/account.py
@@ -117,13 +117,13 @@ class MailAccount(PresenceAccount):
account.int_post_func,
lambda bare_from_jid: real_class.get_default_port()),
("ssl", "boolean", None,
- account.default_post_func,
+ account.boolean_post_func,
lambda bare_from_jid: False),
("store_password", "boolean", None,
- account.default_post_func,
+ account.boolean_post_func,
lambda bare_from_jid: True),
("live_email_only", "boolean", None,
- account.default_post_func,
+ account.boolean_post_func,
lambda bare_from_jid: False),
("interval", "text-single", None,
account.int_post_func,
@@ -654,7 +654,7 @@ class AbstractSMTPAccount(Account):
accounts = account.get_accounts(bare_from_jid, AbstractSMTPAccount,
(AbstractSMTPAccount.q.default_account == True))
already_default_account = (accounts.count() != 0)
- if isinstance(value, str):
+ if isinstance(value, str) or isinstance(value, unicode):
value = value.lower()
bool_value = (value == "true" or value == "1")
else:
@@ -799,10 +799,10 @@ class SMTPAccount(GlobalSMTPAccount):
account.int_post_func,
lambda bare_from_jid: smtp_default_port),
("tls", "boolean", None,
- account.default_post_func,
+ account.boolean_post_func,
lambda bare_from_jid: smtp_default_tls),
("store_password", "boolean", None,
- account.default_post_func,
+ account.boolean_post_func,
lambda bare_from_jid: True)]
get_register_fields = classmethod(_get_register_fields)