1.1 --- a/imiptools/handlers/__init__.py Mon May 18 00:26:37 2015 +0200
1.2 +++ b/imiptools/handlers/__init__.py Mon May 18 00:28:53 2015 +0200
1.3 @@ -26,7 +26,8 @@
1.4 from imiptools.data import Object, \
1.5 get_address, get_uri, get_value, \
1.6 is_new_object, uri_dict, uri_item, uri_values
1.7 -from imiptools.dates import format_datetime, to_recurrence_start, to_timezone
1.8 +from imiptools.dates import format_datetime, to_recurrence_start_point, \
1.9 + to_timezone
1.10 from imiptools.period import can_schedule, remove_period, \
1.11 remove_additional_periods, remove_affected_period, \
1.12 update_freebusy
1.13 @@ -120,18 +121,20 @@
1.14
1.15 # Convenience methods for modifying free/busy collections.
1.16
1.17 - def to_recurrence_start(self, recurrenceid):
1.18 + def to_recurrence_start_point(self, recurrenceid):
1.19
1.20 "Get 'recurrenceid' in a form suitable for matching free/busy entries."
1.21
1.22 - return to_recurrence_start(recurrenceid, self.get_tzid())
1.23 + tzid = self.obj.get_tzid() or self.get_tzid()
1.24 + return to_recurrence_start_point(recurrenceid, tzid)
1.25
1.26 def remove_from_freebusy(self, freebusy):
1.27
1.28 "Remove this event from the given 'freebusy' collection."
1.29
1.30 if not remove_period(freebusy, self.uid, self.recurrenceid) and self.recurrenceid:
1.31 - remove_affected_period(freebusy, self.uid, self.recurrenceid)
1.32 + tzid = self.obj.get_tzid() or self.get_tzid()
1.33 + remove_affected_period(freebusy, self.uid, self.to_recurrence_start_point(self.recurrenceid))
1.34
1.35 def remove_freebusy_for_recurrences(self, freebusy, recurrenceids=None):
1.36
1.37 @@ -144,7 +147,7 @@
1.38 """
1.39
1.40 if self.recurrenceid:
1.41 - recurrenceid = self.to_recurrence_start(self.recurrenceid)
1.42 + recurrenceid = self.to_recurrence_start_point(self.recurrenceid)
1.43 remove_affected_period(freebusy, self.uid, recurrenceid)
1.44 else:
1.45 # Remove obsolete recurrence periods.
1.46 @@ -155,7 +158,7 @@
1.47
1.48 if recurrenceids:
1.49 for recurrenceid in recurrenceids:
1.50 - recurrenceid = self.to_recurrence_start(recurrenceid)
1.51 + recurrenceid = self.to_recurrence_start_point(recurrenceid)
1.52 remove_affected_period(freebusy, self.uid, recurrenceid)
1.53
1.54 def _update_freebusy(self, freebusy, periods, recurrenceid, transp=None):