diff --git a/server/planning/events/events.py b/server/planning/events/events.py index 93089abc7..18aff08f7 100644 --- a/server/planning/events/events.py +++ b/server/planning/events/events.py @@ -797,6 +797,15 @@ def delete_event_files(self, updates, original): if events_using_file.count() == 0: files_service.delete_action(lookup={"_id": file}) + def should_update(self, old_item, new_item, provider): + return old_item is None or not any( + [ + old_item.get("version_creator"), + old_item.get("pubstatus") == "cancelled", + old_item.get("state") == "killed", + ] + ) + class EventsResource(superdesk.Resource): """Resource for events data model diff --git a/server/planning/planning/planning.py b/server/planning/planning/planning.py index 4e130b57c..5ffec82d7 100644 --- a/server/planning/planning/planning.py +++ b/server/planning/planning/planning.py @@ -257,6 +257,9 @@ def on_duplicated(self, doc, parent_id): def on_locked_planning(self, item, user_id): self.generate_related_assignments([item]) + def should_update(self, old_item, new_item, provider): + return True + @staticmethod def set_ingest_provider_sequence(item, provider): """Sets the value of ingest_provider_sequence in item.