[PATCH 2 of 2 saem] [migration] Migration Agent/OrganizationUnit's workflow

Sylvain Thenault sylvain.thenault at logilab.fr
Tue Oct 31 17:56:11 CET 2017


# HG changeset patch
# User Sylvain Thénault <sylvain.thenault at logilab.fr>
# Date 1509459861 -3600
#      Tue Oct 31 15:24:21 2017 +0100
# Node ID 021181ca772dc9dae81cd4205aebb8482056fc31
# Parent  24b65167e016aef51eb65c47d8c2c93772e18b0b
# Available At http://hg.logilab.org/review/cubes/saem_ref
#              hg pull http://hg.logilab.org/review/cubes/saem_ref -r 021181ca772d
[migration] Migration Agent/OrganizationUnit's workflow

Closes extranet #37370184

diff --git a/cubicweb_saem_ref/migration/0.17.0_Any.py b/cubicweb_saem_ref/migration/0.17.0_Any.py
new file mode 100644
--- /dev/null
+++ b/cubicweb_saem_ref/migration/0.17.0_Any.py
@@ -0,0 +1,7 @@
+for etype in ('Agent', 'OrganizationUnit'):
+    wf = get_workflow_for(etype)
+    wf.transition_by_name('publish').cw_delete()
+    wf.state_by_name('draft').cw_delete()
+    wf.cw_set(initial_state=wf.state_by_name('publish'))
+    cnx.execute('DELETE TrInfo X WHERE NOT X from_state S')
+    cnx.commit()


More information about the saem-devel mailing list