Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
blog
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Admin message
la forge Heptapod sera en maintenance de 12h à 13h le mardi 01 avril 2025
Show more breadcrumbs
cubicweb
cubes
blog
Commits
5a91d8db61a2
Commit
5a91d8db61a2
authored
15 years ago
by
Sylvain Thénault
Browse files
Options
Downloads
Patches
Plain Diff
take care not selecting published state from another workflow
parent
c806a41eecf2
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
migration/1.7.0_Any.py
+12
-8
12 additions, 8 deletions
migration/1.7.0_Any.py
with
12 additions
and
8 deletions
migration/1.7.0_Any.py
+
12
−
8
View file @
5a91d8db
...
...
@@ -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
()
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment