Skip to content
Snippets Groups Projects
Commit 5a91d8db61a2 authored by Sylvain Thénault's avatar Sylvain Thénault
Browse files

take care not selecting published state from another workflow

parent c806a41eecf2
No related branches found
No related tags found
No related merge requests found
......@@ -4,5 +4,6 @@
# add BlogEntry workflow
bwf = add_workflow(_('default BlogEntry workflow'), 'BlogEntry')
if confirm('add blog entry workflow'):
bwf = add_workflow(_('default BlogEntry workflow'), 'BlogEntry')
......@@ -8,4 +9,4 @@
draft = bwf.add_state(_('draft'), initial=True)
published = bwf.add_state(_('published'))
draft = bwf.add_state(_('draft'), initial=True)
published = bwf.add_state(_('published'))
......@@ -11,8 +12,8 @@
publish = bwf.add_transition(_('publish'), draft, published,
('managers',))
checkpoint()
publish = bwf.add_transition(_('publish'), draft, published,
('managers',))
checkpoint()
# set state to published for already existing blog entries
blogentries = rql('Any B WHERE B is BlogEntry')
......@@ -15,8 +16,11 @@
# set state to published for already existing blog entries
blogentries = rql('Any B WHERE B is BlogEntry')
for blogentry in blogentries:
session.unsafe_execute('SET B in_state S WHERE S name "published", B eid %(b)s', {'b': blogentry[0]})
for eid, in blogentries:
session.unsafe_execute('SET B in_state S WHERE S name "published", '
'S state_of WF, WF name "default BlogEntry workflow", '
'B eid %(b)s',
{'b': eid}, 'b')
checkpoint()
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment