add a commit point, a new transition exhibits the problem again stable
authorAurelien Campeas <aurelien.campeas@logilab.fr>
Thu, 08 Oct 2009 11:58:19 +0200
branchstable
changeset 3617 9036a8fbbd57
parent 3616 600ee58a1375
child 3618 ad04840ab25c
add a commit point, a new transition exhibits the problem again
entities/test/unittest_wfobjs.py
etwist/server.py
server/hooks.py
--- a/entities/test/unittest_wfobjs.py	Thu Oct 08 11:44:06 2009 +0200
+++ b/entities/test/unittest_wfobjs.py	Thu Oct 08 11:58:19 2009 +0200
@@ -173,15 +173,19 @@
         created    = twf.add_state(_('created'), initial=True)
         identified = twf.add_state(_('identified'))
         released   = twf.add_state(_('released'))
+        closed   = twf.add_state(_('closed'))
         twf.add_wftransition(_('identify'), subwf, (created,),
                              [(xsigned, identified), (xaborted, created)])
         twf.add_wftransition(_('release'), subwf, (identified,),
                              [(xsigned, released), (xaborted, identified)])
+        twf.add_wftransition(_('close'), subwf, (released,),
+                             [(xsigned, closed), (xaborted, released)])
         self.commit()
         group = self.add_entity('CWGroup', name=u'grp1')
         self.commit()
-        for trans in ('identify', 'release'):
+        for trans in ('identify', 'release', 'close'):
             group.fire_transition(trans)
+            self.commit()
 
     def test_subworkflow_base(self):
         """subworkflow
--- a/etwist/server.py	Thu Oct 08 11:44:06 2009 +0200
+++ b/etwist/server.py	Thu Oct 08 11:58:19 2009 +0200
@@ -167,7 +167,7 @@
                         datadir = self.config.locate_resource(segments[1])
                         if datadir is None:
                             return None, []
-                    self.info('static file %s from %s', segments[-1], datadir)
+                    #self.info('static file %s from %s', segments[-1], datadir)
                     if segments[0] == 'data':
                         return static.File(str(datadir)), segments[1:]
                     else:
--- a/server/hooks.py	Thu Oct 08 11:44:06 2009 +0200
+++ b/server/hooks.py	Thu Oct 08 11:58:19 2009 +0200
@@ -520,6 +520,7 @@
                 raise ValidationError(entity.eid, {'by_transition': msg})
             if not tr.has_input_state(fromstate):
                 msg = session._("transition isn't allowed")
+                print tr.name, fromstate.name, entity.by_transition
                 raise ValidationError(entity.eid, {'by_transition': msg})
             if not tr.may_be_fired(foreid):
                 msg = session._("transition may not be fired")