1.1 --- a/imiptools/content.py Thu Mar 05 16:30:13 2015 +0100
1.2 +++ b/imiptools/content.py Thu Mar 05 17:15:57 2015 +0100
1.3 @@ -173,19 +173,28 @@
1.4
1.5 remove_period(freebusy, self.uid, self.recurrenceid)
1.6
1.7 - def remove_freebusy_for_recurrences(self, freebusy):
1.8 + def remove_freebusy_for_recurrences(self, freebusy, recurrenceids=None):
1.9
1.10 """
1.11 Remove from 'freebusy' any original recurrence from parent free/busy
1.12 details for the current object, if the current object is a specific
1.13 additional recurrence. Otherwise, remove all additional recurrence
1.14 - information.
1.15 + information corresponding to 'recurrenceids', or if omitted, all
1.16 + recurrences.
1.17 """
1.18
1.19 if self.recurrenceid:
1.20 remove_affected_period(freebusy, self.uid, self.recurrenceid)
1.21 else:
1.22 - remove_additional_periods(freebusy, self.uid)
1.23 + # Remove obsolete recurrence periods.
1.24 +
1.25 + remove_additional_periods(freebusy, self.uid, recurrenceids)
1.26 +
1.27 + # Remove original periods affected by additional recurrences.
1.28 +
1.29 + if recurrenceids:
1.30 + for recurrenceid in recurrenceids:
1.31 + remove_affected_period(freebusy, self.uid, recurrenceid)
1.32
1.33 def _update_freebusy(self, freebusy, periods, recurrenceid, transp=None):
1.34
1.35 @@ -247,7 +256,7 @@
1.36 self.update_freebusy_for_participant(freebusy, periods, participant_attr,
1.37 for_organiser and self.is_not_attendee(participant, self.obj))
1.38
1.39 - self.remove_freebusy_for_recurrences(freebusy)
1.40 + self.remove_freebusy_for_recurrences(freebusy, self.store.get_recurrences(user, self.uid))
1.41 self.store.set_freebusy_for_other(user, freebusy, participant)
1.42
1.43 def update_freebusy_from_organiser(self, attendee, organiser_item):