From 5bce9edad5896c15280f8fac14efe4c6cc3e9369 Mon Sep 17 00:00:00 2001 From: Florian Reisinger Date: Mon, 4 Nov 2024 09:55:45 +1100 Subject: [PATCH] Only save payload if present --- .../stacks/workflow-manager/workflow_manager/models/utils.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/workload/stateless/stacks/workflow-manager/workflow_manager/models/utils.py b/lib/workload/stateless/stacks/workflow-manager/workflow_manager/models/utils.py index 3d41ab2d3..06e56a0b7 100644 --- a/lib/workload/stateless/stacks/workflow-manager/workflow_manager/models/utils.py +++ b/lib/workload/stateless/stacks/workflow-manager/workflow_manager/models/utils.py @@ -130,7 +130,8 @@ def transition_to(self, new_state: State) -> bool: def persist_state(self, new_state): new_state.workflow_run = self.workflow_run - new_state.payload.save() # Need to save Payload before we can save State + if new_state.payload: + new_state.payload.save() # Need to save Payload before we can save State new_state.save() @staticmethod