~abompard/mailman/subpolicy

« back to all changes in this revision

Viewing changes to src/mailman/model/workflow.py

  • Committer: Aurelien Bompard
  • Date: 2015-04-10 19:47:00 UTC
  • Revision ID: abompard@redhat.com-20150410194700-l35ebzcpdkblmtmk
Make sure stored state is deleted after restoring

Show diffs side-by-side

added added

removed removed

Lines of Context:
62
62
    @dbconnection
63
63
    def restore(self, store, name, key):
64
64
        """See `IWorkflowStateManager`."""
65
 
        return store.query(WorkflowState).get((name, key))
 
65
        state = store.query(WorkflowState).get((name, key))
 
66
        if state is not None:
 
67
            store.delete(state)
 
68
        return state