diff options
author | Thomas Bruederli <bruederli@kolabsys.com> | 2014-10-21 20:09:41 (GMT) |
---|---|---|
committer | Thomas Bruederli <bruederli@kolabsys.com> | 2014-10-21 20:09:41 (GMT) |
commit | 5a1f75bfef79a0c1f41d90e6562c33893f52d9ea (patch) | |
tree | 10aeba8a7dc2b9b2e63de9bc6021908365242e3e /wallace/module_resources.py | |
parent | 36e6988b8ca4ecba317b8b13ceec52928586fdc0 (diff) | |
download | pykolab-5a1f75bfef79a0c1f41d90e6562c33893f52d9ea.tar.gz |
Skip recipient lookup if no iTip parts are found in the message
Diffstat (limited to 'wallace/module_resources.py')
-rw-r--r-- | wallace/module_resources.py | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/wallace/module_resources.py b/wallace/module_resources.py index 0eb4659..c9b5eef 100644 --- a/wallace/module_resources.py +++ b/wallace/module_resources.py @@ -112,7 +112,7 @@ def execute(*args, **kw): if not os.path.isdir(os.path.join(mybasepath, stage)): os.makedirs(os.path.join(mybasepath, stage)) - log.debug(_("Resource Management called for %r, %r") % (args, kw), level=9) + log.debug(_("Resource Management called for %r, %r") % (args, kw), level=8) auth = Auth() imap = IMAP() @@ -169,7 +169,7 @@ def execute(*args, **kw): any_itips = False any_resources = False - possibly_any_resources = True + possibly_any_resources = False reference_uid = None # An iTip message may contain multiple events. Later on, test if the message @@ -197,11 +197,9 @@ def execute(*args, **kw): if any_itips: # See if any iTip actually allocates a resource. - if len([x['resources'] for x in itip_events if x.has_key('resources')]) == 0: - if len([x['attendees'] for x in itip_events if x.has_key('attendees')]) == 0: - possibly_any_resources = False - else: - possibly_any_resources = False + if len([x['resources'] for x in itip_events if x.has_key('resources')]) > 0 \ + or len([x['attendees'] for x in itip_events if x.has_key('attendees')]) > 0: + possibly_any_resources = True if possibly_any_resources: auth.connect() |