rewrite
authorSylvain Thénault <sylvain.thenault@logilab.fr>
Thu, 30 Jul 2009 09:17:02 +0200
changeset 47 95c9fb0120e5
parent 46 61dd37b6bd83
child 48 5a3d2c1f6137
rewrite
migration/postcreate.py
--- a/migration/postcreate.py	Tue Jul 28 01:18:02 2009 +0200
+++ b/migration/postcreate.py	Thu Jul 30 09:17:02 2009 +0200
@@ -1,12 +1,11 @@
 # postcreate script. You could setup a workflow here for example
 # no explicit initial state for Keywords since it depends on the user's groups
 
-for entity_name in ('Keyword', 'CodeKeyword'):
-    pending = add_state(_('validation pending'), entity_name)
-    validated = add_state(_('keyword validated'), entity_name)
-    rejected = add_state(_('keyword rejected'), entity_name)
-    add_transition(_('validate keyword'), entity_name, (pending,), validated,
-                   requiredgroups=('managers',))
-    add_transition(_('reject keyword'), entity_name, (pending,), rejected,
-                   requiredgroups=('managers',))
+pending = add_state(_('validation pending'), ('Keyword', 'CodeKeyword'))
+validated = add_state(_('keyword validated'), ('Keyword', 'CodeKeyword'))
+rejected = add_state(_('keyword rejected'), ('Keyword', 'CodeKeyword'))
+add_transition(_('validate keyword'), ('Keyword', 'CodeKeyword'), (pending,), validated,
+               requiredgroups=('managers',))
+add_transition(_('reject keyword'), ('Keyword', 'CodeKeyword'), (pending,), rejected,
+               requiredgroups=('managers',))