1.1 --- a/imipweb/data.py Fri Oct 13 15:07:43 2017 +0200
1.2 +++ b/imipweb/data.py Fri Oct 13 16:13:42 2017 +0200
1.3 @@ -313,7 +313,7 @@
1.4 current = self.get_checked_periods()
1.5 return combine_periods(original, current)
1.6
1.7 - def classify_period_operations(self):
1.8 + def classify_period_operations(self, is_changed=False):
1.9
1.10 "Classify period update operations."
1.11
1.12 @@ -326,7 +326,7 @@
1.13
1.14 return classify_period_operations(new, replaced, retained, cancelled,
1.15 modified, removed,
1.16 - is_organiser, is_shared)
1.17 + is_organiser, is_shared, is_changed)
1.18
1.19 def properties_changed(self):
1.20
1.21 @@ -350,13 +350,6 @@
1.22
1.23 is_changed = self.properties_changed()
1.24
1.25 - # Determine period modification operations.
1.26 -
1.27 - self.state["period_operations"] = \
1.28 - to_unschedule, to_reschedule, to_add, to_exclude, to_set, \
1.29 - all_unscheduled, all_rescheduled = \
1.30 - self.classify_period_operations()
1.31 -
1.32 # Determine attendee modifications.
1.33
1.34 self.state["attendee_operations"] = \
1.35 @@ -365,6 +358,21 @@
1.36
1.37 self.state["attendees_to_cancel"] = to_cancel
1.38
1.39 + # Determine period modification operations.
1.40 + # Use property changes and attendee suggestions to affect the result for
1.41 + # attendee responses.
1.42 +
1.43 + is_changed = is_changed or to_invite
1.44 +
1.45 + self.state["period_operations"] = \
1.46 + to_unschedule, to_reschedule, to_add, to_exclude, to_set, \
1.47 + all_unscheduled, all_rescheduled = \
1.48 + self.classify_period_operations(is_changed)
1.49 +
1.50 + # Determine whole event update status.
1.51 +
1.52 + is_changed = is_changed or to_set
1.53 +
1.54 # Update event details.
1.55
1.56 if self.can_edit_properties():
1.57 @@ -375,7 +383,7 @@
1.58
1.59 # Classify the nature of any update.
1.60
1.61 - if is_changed or to_set or to_invite:
1.62 + if is_changed:
1.63 self.state["changed"] = "complete"
1.64 elif to_reschedule or to_unschedule or to_add:
1.65 self.state["changed"] = "incremental"
1.66 @@ -1226,7 +1234,7 @@
1.67
1.68 def classify_period_operations(new, replaced, retained, cancelled,
1.69 modified, removed,
1.70 - is_organiser, is_shared):
1.71 + is_organiser, is_shared, is_changed):
1.72
1.73 """
1.74 Classify the operations for the update of an event. For updates modifying
1.75 @@ -1306,9 +1314,10 @@
1.76 to_add = []
1.77
1.78 # Changed periods without new or removed periods are proposed as
1.79 - # separate changes.
1.80 + # separate changes. Parent event changes cause redefinition of the
1.81 + # entire event.
1.82
1.83 - if not new and not removed:
1.84 + if not new and not removed and not is_changed:
1.85 to_set = []
1.86 to_exclude = []
1.87 to_reschedule = list(chain(replaced_modified, retained_modified, reinstated))