summaryrefslogtreecommitdiff
path: root/src/mailman/app/workflow.py
diff options
context:
space:
mode:
Diffstat (limited to 'src/mailman/app/workflow.py')
-rw-r--r--src/mailman/app/workflow.py16
1 files changed, 9 insertions, 7 deletions
diff --git a/src/mailman/app/workflow.py b/src/mailman/app/workflow.py
index 8006f8e51..b83d1c3aa 100644
--- a/src/mailman/app/workflow.py
+++ b/src/mailman/app/workflow.py
@@ -145,10 +145,12 @@ class Workflow:
def restore(self):
state_manager = getUtility(IWorkflowStateManager)
state = state_manager.restore(self.__class__.__name__, self.token)
- if state is not None:
- self._next.clear()
- if state.step:
- self._next.append(state.step)
- if state.data is not None:
- for attr, value in json.loads(state.data).items():
- setattr(self, attr, value)
+ if state is None:
+ # The token doesn't exist in the database.
+ raise LookupError(self.token)
+ self._next.clear()
+ if state.step:
+ self._next.append(state.step)
+ if state.data is not None:
+ for attr, value in json.loads(state.data).items():
+ setattr(self, attr, value)