diff options
-rw-r--r-- | pykolab/xml/event.py | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/pykolab/xml/event.py b/pykolab/xml/event.py index 7ecdf36..9d1f9e6 100644 --- a/pykolab/xml/event.py +++ b/pykolab/xml/event.py @@ -19,6 +19,7 @@ from os import path from attendee import Attendee from contact_reference import ContactReference from recurrence_rule import RecurrenceRule +from collections import OrderedDict log = pykolab.getLogger('pykolab.xml_event') @@ -367,7 +368,8 @@ class Event(object): self.set_from_ical(attr.lower(), ical_event[attr]) # NOTE: Make sure to list(set()) or duplicates may arise - for attr in list(set(ical_event.singletons)): + # NOTE: Keep the original order e.g. to read DTSTART before RECURRENCE-ID + for attr in list(OrderedDict.fromkeys(ical_event.singletons)): if ical_event.has_key(attr): if isinstance(ical_event[attr], list): ical_event[attr] = ical_event[attr][0]; |