--- a/entities/wfobjs.py Tue Aug 18 17:52:08 2009 +0200
+++ b/entities/wfobjs.py Tue Aug 18 18:00:34 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')
@@ -76,6 +77,8 @@
for tr in rset.entities():
if tr.may_be_passed(entity.eid, self.eid):
yield tr
+ else:
+ self.warn('yoo')
def after_deletion_path(self):
"""return (path, parameters) which should be used as redirect
--- a/i18n/en.po Tue Aug 18 17:52:08 2009 +0200
+++ b/i18n/en.po Tue Aug 18 18:00:34 2009 +0200
@@ -107,6 +107,10 @@
msgstr ""
#, python-format
+msgid "%s is not the initial state (%s) for this entity"
+msgstr ""
+
+#, python-format
msgid "%s not estimated"
msgstr ""
@@ -431,6 +435,9 @@
msgid "Recipients:"
msgstr ""
+msgid "Registry's content"
+msgstr ""
+
msgid "Relations"
msgstr ""
@@ -2298,9 +2305,6 @@
msgid "not selected"
msgstr ""
-msgid "not the initial state for this entity"
-msgstr ""
-
msgid "nothing to edit"
msgstr ""
@@ -2437,6 +2441,9 @@
msgid "read_permission_object"
msgstr "has permission to delete"
+msgid "registry"
+msgstr ""
+
#, python-format
msgid "relation %(relname)s of %(ent)s"
msgstr ""
@@ -2830,7 +2837,8 @@
msgid "toggle check boxes"
msgstr ""
-msgid "transition is not allowed"
+#, python-format
+msgid "transition from %s to %s does not exist or is not allowed"
msgstr ""
msgid "transition_of"
--- a/i18n/es.po Tue Aug 18 17:52:08 2009 +0200
+++ b/i18n/es.po Tue Aug 18 18:00:34 2009 +0200
@@ -112,6 +112,10 @@
msgstr "%s reporte de errores"
#, python-format
+msgid "%s is not the initial state (%s) for this entity"
+msgstr ""
+
+#, python-format
msgid "%s not estimated"
msgstr "%s no estimado(s)"
@@ -439,6 +443,9 @@
msgid "Recipients:"
msgstr "Destinatarios"
+msgid "Registry's content"
+msgstr ""
+
msgid "Relations"
msgstr "Relaciones"
@@ -2389,9 +2396,6 @@
msgid "not selected"
msgstr "no seleccionado"
-msgid "not the initial state for this entity"
-msgstr "no el estado inicial para esta entidad"
-
msgid "nothing to edit"
msgstr "nada que editar"
@@ -2527,6 +2531,9 @@
msgid "read_permission_object"
msgstr "Objeto_permiso_lectura"
+msgid "registry"
+msgstr ""
+
#, python-format
msgid "relation %(relname)s of %(ent)s"
msgstr "relación %(relname)s de %(ent)s"
@@ -2928,8 +2935,9 @@
msgid "toggle check boxes"
msgstr "cambiar valor"
-msgid "transition is not allowed"
-msgstr "transition no permitida"
+#, python-format
+msgid "transition from %s to %s does not exist or is not allowed"
+msgstr ""
msgid "transition_of"
msgstr "transicion de"
@@ -3376,6 +3384,9 @@
#~ msgid "not specified"
#~ msgstr "no especificado"
+#~ msgid "not the initial state for this entity"
+#~ msgstr "no el estado inicial para esta entidad"
+
#~ msgid "owned by"
#~ msgstr "appartient ‡"
@@ -3397,6 +3408,9 @@
#~ msgid "synopsis"
#~ msgstr "sinopsis"
+#~ msgid "transition is not allowed"
+#~ msgstr "transition no permitida"
+
#~ msgid "wikiid"
#~ msgstr "identificador wiki"
--- a/i18n/fr.po Tue Aug 18 17:52:08 2009 +0200
+++ b/i18n/fr.po Tue Aug 18 18:00:34 2009 +0200
@@ -112,6 +112,10 @@
msgstr "%s rapport d'erreur"
#, python-format
+msgid "%s is not the initial state (%s) for this entity"
+msgstr "%s n'est pas l'état initial (%s) de cette entité"
+
+#, python-format
msgid "%s not estimated"
msgstr "%s non estimé(s)"
@@ -438,6 +442,9 @@
msgid "Recipients:"
msgstr "Destinataires :"
+msgid "Registry's content"
+msgstr "Contenu du registre"
+
msgid "Relations"
msgstr "Relations"
@@ -2394,9 +2401,6 @@
msgid "not selected"
msgstr "non sélectionné"
-msgid "not the initial state for this entity"
-msgstr "n'est pas l'état initial pour cette entité"
-
msgid "nothing to edit"
msgstr "rien à éditer"
@@ -2534,6 +2538,9 @@
msgid "read_permission_object"
msgstr "a la permission de lire"
+msgid "registry"
+msgstr "registre"
+
#, python-format
msgid "relation %(relname)s of %(ent)s"
msgstr "relation %(relname)s de %(ent)s"
@@ -2940,8 +2947,9 @@
msgid "toggle check boxes"
msgstr "inverser les cases à cocher"
-msgid "transition is not allowed"
-msgstr "transition non permise"
+#, python-format
+msgid "transition from %s to %s does not exist or is not allowed"
+msgstr "la transition de %s à %s n'existe pas ou n'est pas permise"
msgid "transition_of"
msgstr "transition de"
--- a/server/hooks.py Tue Aug 18 17:52:08 2009 +0200
+++ b/server/hooks.py Tue Aug 18 18:00:34 2009 +0200
@@ -430,7 +430,9 @@
try:
iter(state.transitions(entity, toeid)).next()
except StopIteration:
- msg = session._('transition is not allowed')
+ _ = session._
+ msg = _('transition from %s to %s does not exist or is not allowed') % (
+ _(state.name), _(session.entity_from_eid(toeid).name))
raise ValidationError(fromeid, {'in_state': msg})
else:
# not a transition
@@ -438,7 +440,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():