Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
erp5
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Titouan Soulard
erp5
Commits
3f5e7a71
Commit
3f5e7a71
authored
Feb 18, 2024
by
Jérome Perrin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
WorkflowTool: don't emit getWorkflowsFor warning with CMFCore
parent
4c4cd37e
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
3 deletions
+13
-3
product/ERP5Type/Tool/WorkflowTool.py
product/ERP5Type/Tool/WorkflowTool.py
+13
-3
No files found.
product/ERP5Type/Tool/WorkflowTool.py
View file @
3f5e7a71
...
@@ -28,6 +28,8 @@
...
@@ -28,6 +28,8 @@
"""
"""
Most of the code in this file has been taken from patches/WorkflowTool.py
Most of the code in this file has been taken from patches/WorkflowTool.py
"""
"""
import
re
import
warnings
from
six
import
string_types
as
basestring
from
six
import
string_types
as
basestring
from
AccessControl
import
ClassSecurityInfo
,
Unauthorized
from
AccessControl
import
ClassSecurityInfo
,
Unauthorized
from
Acquisition
import
aq_base
from
Acquisition
import
aq_base
...
@@ -257,9 +259,17 @@ class WorkflowTool(BaseTool, OriginalWorkflowTool):
...
@@ -257,9 +259,17 @@ class WorkflowTool(BaseTool, OriginalWorkflowTool):
return
workflow_list
return
workflow_list
# WITH_LEGACY_WORKFLOW
# WITH_LEGACY_WORKFLOW
getWorkflowsFor
=
deprecated
(
__getWorkflowsFor_warning
=
\
"getWorkflowsFor() is deprecated; use getWorkflowValueListFor() instead"
)(
"getWorkflowsFor() is deprecated; use getWorkflowValueListFor() instead"
getWorkflowValueListFor
)
getWorkflowsFor
=
deprecated
(
__getWorkflowsFor_warning
)(
getWorkflowValueListFor
)
# ignore the warning when called from Products.CMFCore, getWorkflowsFor is a
# CMFCore API that is used internally in CMFCore, we only want to warn when
# using it from ERP5.
warnings
.
filterwarnings
(
'ignore'
,
message
=
re
.
escape
(
__getWorkflowsFor_warning
),
module
=
'Products.CMFCore.WorkflowTool'
)
@
deprecated
(
"getChainFor() is deprecated; use getWorkflowValueListFor() instead"
)
@
deprecated
(
"getChainFor() is deprecated; use getWorkflowValueListFor() instead"
)
def
getChainFor
(
self
,
ob
):
def
getChainFor
(
self
,
ob
):
return
[
wf
.
getId
()
for
wf
in
self
.
getWorkflowValueListFor
(
ob
)]
return
[
wf
.
getId
()
for
wf
in
self
.
getWorkflowValueListFor
(
ob
)]
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment