# HG changeset patch # User Paul Boddie # Date 1509575006 -3600 # Node ID 79ff5b0a199c4e256975624446d6578c8326b173 # Parent 9baa0aae5b43c4c2a6539bdc867174d116dc4f4a Update the sequence number when modifying existing separate recurrences. diff -r 9baa0aae5b43 -r 79ff5b0a199c imiptools/client.py --- a/imiptools/client.py Tue Oct 31 23:49:04 2017 +0100 +++ b/imiptools/client.py Wed Nov 01 23:23:26 2017 +0100 @@ -876,6 +876,9 @@ # Attempt to find an existing recurrence. obj = self.get_stored_object(self.uid, p.get_recurrenceid()) + + # Use the template without an existing recurrence. + if not obj: obj = template.copy() @@ -886,6 +889,16 @@ dt, attr = p.get_recurrenceid_item() obj["RECURRENCE-ID"] = [(format_datetime(dt), attr)] + # Update any sequence number if the period has changed from any + # stored version. + # NOTE: Attendance changes would also be propagated and have + # NOTE: this effect. + + else: + main = obj.get_main_period() + if main != p: + self.update_sequence(obj) + # Set specific recurrence information. obj.set_datetime("DTSTART", p.get_start())