summaryrefslogtreecommitdiffstats
path: root/pykolab/plugins/recipientpolicy
diff options
context:
space:
mode:
authorChristoph Erhardt <kolab@sicherha.de>2021-06-05 11:51:27 +0200
committerChristoph Erhardt <kolab@sicherha.de>2022-01-10 20:50:41 +0100
commit9a5f92139d3fbe7fa1945d38198a9cdc74831ac5 (patch)
tree03fff0f479a90dfaa70c6647dd0923086560dcca /pykolab/plugins/recipientpolicy
parentc3b9d5557161f840a8f2c45fc91ec09299593dd9 (diff)
downloadpykolab-9a5f92139d3fbe7fa1945d38198a9cdc74831ac5.tar.gz
[Python 3] Get rid of .has_key()
Summary: `dict.has_key(key)` was dropped in Python 3.0. Use `key in dict` instead. Reviewers: machniak, mollekopf Reviewed By: mollekopf Differential Revision: https://git.kolab.org/D3241
Diffstat (limited to 'pykolab/plugins/recipientpolicy')
-rw-r--r--pykolab/plugins/recipientpolicy/__init__.py10
1 files changed, 5 insertions, 5 deletions
diff --git a/pykolab/plugins/recipientpolicy/__init__.py b/pykolab/plugins/recipientpolicy/__init__.py
index 94c707f..330ddfa 100644
--- a/pykolab/plugins/recipientpolicy/__init__.py
+++ b/pykolab/plugins/recipientpolicy/__init__.py
@@ -56,12 +56,12 @@ class KolabRecipientpolicy(object):
user_attrs = utils.normalize(kw['entry'])
- if not user_attrs.has_key('domain'):
+ if 'domain' not in user_attrs:
user_attrs['domain'] = kw['primary_domain']
elif not user_attrs['domain'] == kw['primary_domain']:
user_attrs['domain'] = kw['primary_domain']
- if not user_attrs.has_key('preferredlanguage'):
+ if 'preferredlanguage' not in user_attrs:
default_locale = conf.get(user_attrs['domain'], 'default_locale')
if default_locale == None:
default_locale = conf.get('kolab', 'default_locale')
@@ -77,7 +77,7 @@ class KolabRecipientpolicy(object):
return mail
except KeyError:
log.warning(_("Attribute substitution for 'mail' failed in Recipient Policy"))
- if user_attrs.has_key('mail'):
+ if 'mail' in user_attrs:
return user_attrs['mail']
else:
return None
@@ -96,12 +96,12 @@ class KolabRecipientpolicy(object):
user_attrs = utils.normalize(kw['entry'])
- if not user_attrs.has_key('domain'):
+ if 'domain' not in user_attrs:
user_attrs['domain'] = kw['primary_domain']
elif not user_attrs['domain'] == kw['primary_domain']:
user_attrs['domain'] = kw['primary_domain']
- if not user_attrs.has_key('preferredlanguage'):
+ if 'preferredlanguage' not in user_attrs:
default_locale = conf.get(user_attrs['domain'], 'default_locale')
if default_locale == None:
default_locale = conf.get(user_attrs['domain'], 'default_locale')