1.1 --- a/imiptools/editing.py Mon Dec 11 00:32:37 2017 +0100
1.2 +++ b/imiptools/editing.py Mon Dec 11 22:09:38 2017 +0100
1.3 @@ -1421,6 +1421,8 @@
1.4 # incremental updates.
1.5
1.6 cancelled_removed = select_recurrences(cancelled, removed).values()
1.7 + cancelled_main = get_main_period(cancelled_removed)
1.8 + cancelled_main = cancelled_main and [cancelled_main] or []
1.9
1.10 # Reinstated periods are previously-cancelled periods that are now modified
1.11 # periods, and they appear in updates.
1.12 @@ -1463,7 +1465,7 @@
1.13
1.14 if not is_shared or new and not replaced:
1.15 to_set = active_non_rule
1.16 - to_exclude = list(chain(cancelled_rule, obsolete_rule))
1.17 + to_exclude = list(chain(cancelled_rule, obsolete_rule, cancelled_main))
1.18 to_unschedule = []
1.19 to_reschedule = []
1.20 to_add = []
1.21 @@ -1504,7 +1506,7 @@
1.22
1.23 else:
1.24 to_set = active_non_rule
1.25 - to_exclude = list(chain(cancelled, obsolete_rule))
1.26 + to_exclude = list(chain(cancelled, obsolete_rule, cancelled_main))
1.27 to_reschedule = []
1.28 all_unscheduled = []
1.29 all_rescheduled = []