Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
erp5-Boxiang
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
Hamza
erp5-Boxiang
Commits
70ad0fcb
Commit
70ad0fcb
authored
Dec 16, 2014
by
wenjie.zheng
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
lazy_class: Avoid using hasattr.
parent
9f2212cf
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
6 deletions
+6
-6
product/ERP5Type/dynamic/lazy_class.py
product/ERP5Type/dynamic/lazy_class.py
+6
-6
No files found.
product/ERP5Type/dynamic/lazy_class.py
View file @
70ad0fcb
...
...
@@ -269,10 +269,12 @@ class PortalTypeMetaClass(GhostBaseMetaClass, PropertyHolder):
# ================== ERP5Workflow Project, Wenjie, Dec 2014 =======================
portal_type
=
site
.
getDefaultModule
(
portal_type
=
"portal_types"
)
### try to get workflow_list from related types then initialize the class of types
try
:
pt
=
portal_type
.
_getOb
(
cls
.
__name__
)
#raise NotImplemented (pt)
if
hasattr
(
pt
,
'workflow_list'
):
pt
=
getattr
(
portal_type
,
cls
.
__name__
,
None
)
if
pt
is
not
None
:
#pt = portal_type._getOb(cls.__name__)
#raise NotImplemented (pt)
wf
=
getattr
(
pt
,
'workflow_list'
,
None
)
if
wf
is
not
None
:
### Get ERP5Workflow Module
portal_ERP5Workflow
=
site
.
getDefaultModule
(
portal_type
=
"Workflow"
)
if
portal_ERP5Workflow
is
None
:
...
...
@@ -282,8 +284,6 @@ class PortalTypeMetaClass(GhostBaseMetaClass, PropertyHolder):
else
:
### Generate Workflow Method
intializePortalTypeERP5WorkflowMethod
(
cls
,
portal_ERP5Workflow
)
except
:
pass
# ================== WF5 =======================================================
# portal type group methods, isNodeType, isResourceType...
...
...
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