entities/wfobjs.py
changeset 3458 b7621175989a
parent 3451 6b46d73823f5
child 3536 f6c9a5df80fb
--- a/entities/wfobjs.py	Wed Sep 23 20:13:31 2009 +0200
+++ b/entities/wfobjs.py	Wed Sep 23 23:28:59 2009 +0200
@@ -452,7 +452,9 @@
         """
         assert self.current_workflow
         tr = self.current_workflow.transition_by_name(trname)
-        assert tr is not None, 'not a %s transition: %s' % (self.__regid__, trname)
+        if tr is None:
+            raise WorkflowException('not a %s transition: %s' % (self.__regid__,
+                                                                 trname))
         return self._add_trinfo(comment, commentformat, tr.eid)
 
     def change_state(self, statename, comment=None, commentformat=None, tr=None):