# HG changeset patch # User Aurelien Campeas # Date 1250603446 -7200 # Node ID 1c42a9826dd486a2ae2bfb26e9c3192ff3b825ba # Parent b9d3f7f884cea1df83167a1969abf579b2208c05 [hooks] say which are the states diff -r b9d3f7f884ce -r 1c42a9826dd4 entities/wfobjs.py --- a/entities/wfobjs.py Tue Aug 18 14:27:27 2009 +0200 +++ b/entities/wfobjs.py Tue Aug 18 15:50:46 2009 +0200 @@ -66,6 +66,7 @@ rest_attr = 'eid' def transitions(self, entity, desteid=None): + """generates transition that MAY be passed""" rql = ('Any T,N,DS where S allowed_transition T, S eid %(x)s, ' 'T name N, T destination_state DS, ' 'T transition_of ET, ET name %(et)s') diff -r b9d3f7f884ce -r 1c42a9826dd4 server/hooks.py --- a/server/hooks.py Tue Aug 18 14:27:27 2009 +0200 +++ b/server/hooks.py Tue Aug 18 15:50:46 2009 +0200 @@ -438,7 +438,9 @@ isrset = session.unsafe_execute('Any S WHERE ET initial_state S, ET name %(etype)s', {'etype': etype}) if isrset and not toeid == isrset[0][0]: - msg = session._('not the initial state for this entity') + _ = session._ + msg = _('%s is not the initial state (%s) for this entity') % ( + _(session.entity_from_eid(toeid).name), _(isrset.get_entity(0,0).name)) raise ValidationError(fromeid, {'in_state': msg}) eschema = session.repo.schema[etype] if not 'wf_info_for' in eschema.object_relations():