summaryrefslogtreecommitdiff
path: root/wallace/module_resources.py
diff options
context:
space:
mode:
authorThomas Bruederli <bruederli@kolabsys.com>2014-02-20 08:37:09 (GMT)
committerThomas Bruederli <bruederli@kolabsys.com>2014-02-20 08:37:09 (GMT)
commitcffe8974b83342773fd28b5ce14540e34a88cf64 (patch)
tree8e8ff919fed909cb414a37acf3f9bc3b107b7695 /wallace/module_resources.py
parent5b59c3723ae76401bde695c56938ae0b2f8b81f5 (diff)
downloadpykolab-cffe8974b83342773fd28b5ce14540e34a88cf64.tar.gz
Minor fixes for passing unit tests
Diffstat (limited to 'wallace/module_resources.py')
-rw-r--r--wallace/module_resources.py15
1 files changed, 10 insertions, 5 deletions
diff --git a/wallace/module_resources.py b/wallace/module_resources.py
index 84447c2..dfd419a 100644
--- a/wallace/module_resources.py
+++ b/wallace/module_resources.py
@@ -560,7 +560,7 @@ def itip_events_from_message(message):
# The iTip part MUST be Content-Type: text/calendar (RFC 6047, section 2.4)
# But in real word, other mime-types are used as well
if part.get_content_type() in [ "text/calendar", "text/x-vcalendar", "application/ics" ]:
- if not part.get_param('method').upper() in itip_methods:
+ if not str(part.get_param('method')).upper() in itip_methods:
log.error(
_("Method %r not really interesting for us.") % (
part.get_param('method')
@@ -664,9 +664,12 @@ def resource_record_from_email_address(email_address):
"""
Resolves the given email address to a resource entity
"""
+ global auth
+
+ if not auth:
+ auth = Auth()
+ auth.connect()
- auth = Auth()
- auth.connect()
resource_records = []
log.debug(
@@ -696,9 +699,11 @@ def resource_records_from_itip_events(itip_events, recipient_email=None):
Given a list of itip_events, determine which resources have been
invited as attendees and/or resources.
"""
+ global auth
- auth = Auth()
- auth.connect()
+ if not auth:
+ auth = Auth()
+ auth.connect()
resource_records = []