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
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Xiaowu Zhang
erp5
Commits
813f2f89
Commit
813f2f89
authored
Aug 01, 2011
by
Julien Muchembled
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
CMFActivity: stop using getToolByName
parent
12eda3c3
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
10 deletions
+12
-10
product/CMFActivity/ActiveObject.py
product/CMFActivity/ActiveObject.py
+6
-5
product/CMFActivity/ActivityTool.py
product/CMFActivity/ActivityTool.py
+6
-5
No files found.
product/CMFActivity/ActiveObject.py
View file @
813f2f89
...
...
@@ -29,7 +29,6 @@
import
ExtensionClass
from
AccessControl
import
ClassSecurityInfo
from
Acquisition
import
aq_base
from
Products.CMFCore.utils
import
getToolByName
from
Products.ERP5Type.TransactionalVariable
import
getTransactionalVariable
from
ActivityRuntimeEnvironment
import
getActivityRuntimeEnvironment
...
...
@@ -123,8 +122,9 @@ class ActiveObject(ExtensionClass.Base):
security
.
declareProtected
(
permissions
.
ModifyPortalContent
,
'flushActivity'
)
def
flushActivity
(
self
,
invoke
=
0
,
**
kw
):
activity_tool
=
getToolByName
(
self
.
getPortalObject
(),
'portal_activities'
,
None
)
if
activity_tool
is
None
:
try
:
activity_tool
=
self
.
getPortalObject
().
portal_activities
except
AttributeError
:
return
# Do nothing if no portal_activities
# flush all activities related to this object
activity_tool
.
flush
(
self
,
invoke
=
invoke
,
**
kw
)
...
...
@@ -143,8 +143,9 @@ class ActiveObject(ExtensionClass.Base):
def
hasActivity
(
self
,
**
kw
):
"""Tells if there is pending activities for this object.
"""
activity_tool
=
getToolByName
(
self
.
getPortalObject
(),
'portal_activities'
,
None
)
if
activity_tool
is
None
:
try
:
activity_tool
=
self
.
getPortalObject
().
portal_activities
except
AttributeError
:
return
0
# Do nothing if no portal_activities
return
activity_tool
.
hasActivity
(
self
,
**
kw
)
...
...
product/CMFActivity/ActivityTool.py
View file @
813f2f89
...
...
@@ -44,7 +44,7 @@ from AccessControl.SecurityManagement import newSecurityManager
from
AccessControl.SecurityManagement
import
noSecurityManager
from
AccessControl.SecurityManagement
import
setSecurityManager
from
AccessControl.SecurityManagement
import
getSecurityManager
from
Products.CMFCore.utils
import
UniqueObject
,
_getAuthenticatedUser
,
getToolByName
from
Products.CMFCore.utils
import
UniqueObject
,
_getAuthenticatedUser
from
Products.ERP5Type.Globals
import
InitializeClass
,
DTMLFile
from
Acquisition
import
aq_base
,
aq_inner
,
aq_parent
from
ActivityBuffer
import
ActivityBuffer
...
...
@@ -922,9 +922,10 @@ class ActivityTool (Folder, UniqueObject):
# with TimerService we have the same REQUEST over multiple
# portals, we clear this cache to make sure the cache doesn't
# contains skins from another portal.
stool
=
getToolByName
(
self
,
'portal_skins'
,
None
)
if
stool
is
not
None
:
stool
.
changeSkin
(
None
)
try
:
self
.
getPortalObject
().
portal_skins
.
changeSkin
(
None
)
except
AttributeError
:
pass
# call tic for the current processing_node
# the processing_node numbers are the indices of the elements in the node tuple +1
...
...
@@ -1321,7 +1322,7 @@ class ActivityTool (Folder, UniqueObject):
"""
Clear all activities and recreate tables.
"""
folder
=
getToolByName
(
self
,
'portal_skins'
).
activity
folder
=
self
.
getPortalObject
().
portal_skins
# Obtain all pending messages.
message_list_dict
=
{}
...
...
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