improve error message for redundant initial workflow states stable
authorPierre-Yves David <pierre-yves.david@logilab.fr>
Tue, 01 Dec 2009 19:58:51 +0100
branchstable
changeset 3959 e6ecaf93c0ba
parent 3958 505025eb0d37
child 3962 15d9d47f5434
improve error message for redundant initial workflow states
entities/wfobjs.py
--- a/entities/wfobjs.py	Tue Dec 01 19:29:56 2009 +0100
+++ b/entities/wfobjs.py	Tue Dec 01 19:58:51 2009 +0100
@@ -101,7 +101,7 @@
         self.req.execute('SET S state_of WF WHERE S eid %(s)s, WF eid %(wf)s',
                          {'s': state.eid, 'wf': self.eid}, ('s', 'wf'))
         if initial:
-            assert not self.initial
+            assert not self.initial, "Initial state already defined as %s" % self.initial
             self.req.execute('SET WF initial_state S '
                              'WHERE S eid %(s)s, WF eid %(wf)s',
                              {'s': state.eid, 'wf': self.eid}, ('s', 'wf'))