summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAleksander Machniak <machniak@kolabsys.com>2018-06-21 08:20:37 +0000
committerAleksander Machniak <machniak@kolabsys.com>2018-06-21 08:20:37 +0000
commit417afca39a5b68e2134ec74b2a573f0b827889a9 (patch)
treebbbf6aff5e32678b009317008a11a79358582728
parentc91c18827c5c16e266be2f9e63d87b9ac78be1ec (diff)
downloadpykolab-417afca39a5b68e2134ec74b2a573f0b827889a9.tar.gz
Fix invitationpolicy error on an itip reply with no ORGANIZER prop (Bifrost#T114576)
-rw-r--r--pykolab/itip/__init__.py5
-rw-r--r--wallace/module_invitationpolicy.py8
2 files changed, 9 insertions, 4 deletions
diff --git a/pykolab/itip/__init__.py b/pykolab/itip/__init__.py
index 925fede..6258dfb 100644
--- a/pykolab/itip/__init__.py
+++ b/pykolab/itip/__init__.py
@@ -106,10 +106,11 @@ def objects_from_message(message, objnames, methods=None):
itip['duration'] = c['duration'].dt
itip['end'] = itip['start'] + c['duration'].dt
- if (c.has_key('organizer')):
+ # Outlook can send itip replies with no organizer property
+ if c.has_key('organizer'):
itip['organizer'] = c['organizer']
- if (c.has_key('attendee')):
+ if c.has_key('attendee'):
itip['attendees'] = c['attendee']
if itip.has_key('attendees') and not isinstance(itip['attendees'], list):
diff --git a/wallace/module_invitationpolicy.py b/wallace/module_invitationpolicy.py
index a2a37fe..9a87ca5 100644
--- a/wallace/module_invitationpolicy.py
+++ b/wallace/module_invitationpolicy.py
@@ -319,8 +319,12 @@ def execute(*args, **kw):
# for replies, the organizer is the recipient
if itip_event['method'] == 'REPLY':
- organizer_mailto = str(itip_event['organizer']).split(':')[-1]
- user_attendees = [organizer_mailto] if organizer_mailto in recipient_emails else []
+ # Outlook can send iTip replies without an organizer property
+ if itip_event.has_key('organizer'):
+ organizer_mailto = str(itip_event['organizer']).split(':')[-1]
+ user_attendees = [organizer_mailto] if organizer_mailto in recipient_emails else []
+ else:
+ user_attendees = [recipient_email]
else:
# Limit the attendees to the one that is actually invited with the current message.