1.1 --- a/imiptools/data.py Thu Sep 03 19:00:50 2015 +0200
1.2 +++ b/imiptools/data.py Thu Sep 03 19:07:13 2015 +0200
1.3 @@ -95,6 +95,9 @@
1.4 else:
1.5 return None
1.6
1.7 + def get_recurrence_start_points(self, recurrenceids, tzid):
1.8 + return [self.get_recurrence_start_point(recurrenceid, tzid) for recurrenceid in recurrenceids]
1.9 +
1.10 # Structure access.
1.11
1.12 def copy(self):
2.1 --- a/imiptools/period.py Thu Sep 03 19:00:50 2015 +0200
2.2 +++ b/imiptools/period.py Thu Sep 03 19:07:13 2015 +0200
2.3 @@ -209,6 +209,31 @@
2.4 def __repr__(self):
2.5 return "FreeBusyPeriod%r" % (self.as_tuple(),)
2.6
2.7 + # Period and event recurrence logic.
2.8 +
2.9 + def is_replaced(self, recurrences):
2.10 +
2.11 + """
2.12 + Return whether this period refers to one of the 'recurrences'.
2.13 + The 'recurrences' must be UTC datetimes corresponding to the start of
2.14 + the period described by a recurrence.
2.15 + """
2.16 +
2.17 + for recurrence in recurrences:
2.18 + if self.is_affected(recurrence):
2.19 + return True
2.20 + return False
2.21 +
2.22 + def is_affected(self, recurrence):
2.23 +
2.24 + """
2.25 + Return whether this period refers to 'recurrence'. The 'recurrence' must
2.26 + be a UTC datetime corresponding to the start of the period described by
2.27 + a recurrence.
2.28 + """
2.29 +
2.30 + return recurrence and self.get_start_point() == recurrence
2.31 +
2.32 class RecurringPeriod(Period):
2.33
2.34 """
3.1 --- a/imipweb/event.py Thu Sep 03 19:00:50 2015 +0200
3.2 +++ b/imipweb/event.py Thu Sep 03 19:07:13 2015 +0200
3.3 @@ -677,7 +677,7 @@
3.4 recurrenceid = obj.get_recurrenceid()
3.5
3.6 if recurrenceid:
3.7 - parent = self.get_stored_object(uid)
3.8 + parent = self.get_stored_object(uid, None)
3.9 if not parent:
3.10 return
3.11
3.12 @@ -828,9 +828,10 @@
3.13
3.14 participant_attr = attendee_map.get(participant)
3.15 partstat = participant_attr and participant_attr.get("PARTSTAT")
3.16 + recurrences = obj.get_recurrence_start_points(recurrenceids, tzid)
3.17
3.18 for p in have_conflict(freebusy, periods, True):
3.19 - if not recurrenceid and p.is_replaced(recurrenceids):
3.20 + if not recurrenceid and p.is_replaced(recurrences):
3.21 continue
3.22
3.23 if ( # Unidentified or different event