summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAleksander Machniak <machniak@kolabsys.com>2016-04-14 11:39:18 +0200
committerJeroen van Meeuwen (Kolab Systems) <vanmeeuwen@kolabsys.com>2016-04-14 11:39:18 +0200
commitcd51586559ec5367f88862650fd391c20e859b71 (patch)
tree8613879442383ab2f6c777cfc35f03c758f50b72
parentec6b2d60c2bc8253c83a62218c90563c1850975c (diff)
downloadpykolab-cd51586559ec5367f88862650fd391c20e859b71.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)):