summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAleksander Machniak <machniak@kolabsys.com>2016-04-14 11:40:08 +0200
committerJeroen van Meeuwen (Kolab Systems) <vanmeeuwen@kolabsys.com>2016-04-14 11:40:08 +0200
commitfc0e4bcf7057cf417f1009f15f16b41b61f1151a (patch)
treef391f33b48bf30926632d6e8f281730dcfdd8268
parent5d7db9f2406ccee7b43d3939bebc2d53367e7798 (diff)
downloadpykolab-fc0e4bcf7057cf417f1009f15f16b41b61f1151a.tar.gz
Fix AttributeError while parsing iCal message with duplicated some fields (#5367)
Summary: Fixes #5367 Reviewers: #pykolab_developers, vanmeeuwen Reviewed By: #pykolab_developers, vanmeeuwen Differential Revision: https://git.kolab.org/D123
-rw-r--r--pykolab/xml/event.py2
-rw-r--r--pykolab/xml/todo.py2
2 files changed, 4 insertions, 0 deletions
diff --git a/pykolab/xml/event.py b/pykolab/xml/event.py
index e2e5440..be49083 100644
--- a/pykolab/xml/event.py
+++ b/pykolab/xml/event.py
@@ -351,6 +351,8 @@ class Event(object):
# NOTE: Make sure to list(set()) or duplicates may arise
for attr in list(set(ical_event.singletons)):
if ical_event.has_key(attr):
+ if isinstance(ical_event[attr], list):
+ ical_event[attr] = ical_event[attr][0];
self.set_from_ical(attr.lower(), ical_event[attr])
# NOTE: Make sure to list(set()) or duplicates may arise
diff --git a/pykolab/xml/todo.py b/pykolab/xml/todo.py
index 2103427..f2fde39 100644
--- a/pykolab/xml/todo.py
+++ b/pykolab/xml/todo.py
@@ -95,6 +95,8 @@ class Todo(Event):
for attr in list(set(ical_todo.singletons)):
if ical_todo.has_key(attr):
+ if isinstance(ical_todo[attr], list):
+ ical_todo[attr] = ical_todo[attr][0];
self.set_from_ical(attr.lower(), ical_todo[attr])
for attr in list(set(ical_todo.multiple)):