1.1 --- a/imiptools/client.py Tue Oct 31 23:49:04 2017 +0100
1.2 +++ b/imiptools/client.py Wed Nov 01 23:23:26 2017 +0100
1.3 @@ -876,6 +876,9 @@
1.4 # Attempt to find an existing recurrence.
1.5
1.6 obj = self.get_stored_object(self.uid, p.get_recurrenceid())
1.7 +
1.8 + # Use the template without an existing recurrence.
1.9 +
1.10 if not obj:
1.11 obj = template.copy()
1.12
1.13 @@ -886,6 +889,16 @@
1.14 dt, attr = p.get_recurrenceid_item()
1.15 obj["RECURRENCE-ID"] = [(format_datetime(dt), attr)]
1.16
1.17 + # Update any sequence number if the period has changed from any
1.18 + # stored version.
1.19 + # NOTE: Attendance changes would also be propagated and have
1.20 + # NOTE: this effect.
1.21 +
1.22 + else:
1.23 + main = obj.get_main_period()
1.24 + if main != p:
1.25 + self.update_sequence(obj)
1.26 +
1.27 # Set specific recurrence information.
1.28
1.29 obj.set_datetime("DTSTART", p.get_start())