summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJeroen van Meeuwen (Kolab Systems) <vanmeeuwen@kolabsys.com>2011-12-06 12:43:57 +0000
committerJeroen van Meeuwen (Kolab Systems) <vanmeeuwen@kolabsys.com>2011-12-06 12:43:57 +0000
commit339ca6bddefc166c487ecdd4092f9f34b274ff7f (patch)
tree5a33f331ab865bc3f121d50dc8b8fa7463a96e05
parentc26dbac28dfdb62e2f6a47ccd75c562819bc6156 (diff)
downloadpykolab-339ca6bddefc166c487ecdd4092f9f34b274ff7f.tar.gz
Update default_locale setting (default and obtaining)
-rw-r--r--pykolab/auth/ldap/__init__.py7
-rw-r--r--pykolab/conf/defaults.py2
2 files changed, 7 insertions, 2 deletions
diff --git a/pykolab/auth/ldap/__init__.py b/pykolab/auth/ldap/__init__.py
index e7de7d2..0d88981 100644
--- a/pykolab/auth/ldap/__init__.py
+++ b/pykolab/auth/ldap/__init__.py
@@ -1039,7 +1039,12 @@ class LDAP(object):
user[key] = _user_attrs[key]
if user['preferredLanguage'] == None:
- self._set_user_attribute(user, 'preferredLanguage', conf.get('ldap', 'default_locale'))
+ if conf.has_option(primary_domain, 'default_locale'):
+ default_locale = conf.get(primary_domain, 'default_locale')
+ else:
+ default_locale = conf.get('kolab','default_locale')
+
+ self._set_user_attribute(user, 'preferredLanguage', default_locale)
# Check to see if we want to apply a primary mail recipient policy
if conf.has_option(primary_domain, 'primary_mail'):
diff --git a/pykolab/conf/defaults.py b/pykolab/conf/defaults.py
index 17f4724..e9c4088 100644
--- a/pykolab/conf/defaults.py
+++ b/pykolab/conf/defaults.py
@@ -31,4 +31,4 @@ class Defaults(object):
self.address_search_attrs = "mail, alias"
- self.default_locale = 'en_US'
+ self.kolab_default_locale = 'en_US'