Commit 511d09c8 authored by Julien Muchembled's avatar Julien Muchembled

Remove useless [gs]etPlacelessDefaultActivateParameters methods

They duplicate [gs]etDefaultActivateParameterDict on ActiveObject.
parent f1df95b7
...@@ -1528,15 +1528,6 @@ class ERP5Site(FolderMixIn, CMFSite, CacheCookieMixin): ...@@ -1528,15 +1528,6 @@ class ERP5Site(FolderMixIn, CMFSite, CacheCookieMixin):
key = ('default_reindex_parameter', ) key = ('default_reindex_parameter', )
tv[key] = kw tv[key] = kw
security.declarePublic('setPlacelessDefaultActivateParameters')
def setPlacelessDefaultActivateParameters(self, **kw):
# This method sets the default keyword parameters to activate. This is useful
# when you need to specify special parameters implicitly (e.g. to reindexObject).
# Those parameters will affect all activate calls, not just ones on self.
tv = getTransactionalVariable()
key = ('default_activate_parameter', )
tv[key] = kw
security.declarePublic('getPlacelessDefaultReindexParameters') security.declarePublic('getPlacelessDefaultReindexParameters')
def getPlacelessDefaultReindexParameters(self): def getPlacelessDefaultReindexParameters(self):
# This method returns default reindex parameters to self. # This method returns default reindex parameters to self.
...@@ -1545,14 +1536,6 @@ class ERP5Site(FolderMixIn, CMFSite, CacheCookieMixin): ...@@ -1545,14 +1536,6 @@ class ERP5Site(FolderMixIn, CMFSite, CacheCookieMixin):
key = ('default_reindex_parameter', ) key = ('default_reindex_parameter', )
return tv.get(key) return tv.get(key)
security.declarePublic('getPlacelessDefaultActivateParameters')
def getPlacelessDefaultActivateParameters(self):
# This method returns default activate parameters to self.
# The result can be either a dict object or None.
tv = getTransactionalVariable()
key = ('default_activate_parameter', )
return tv.get(key)
security.declareProtected(Permissions.ManagePortal, 'getERP5SiteGlobalId') security.declareProtected(Permissions.ManagePortal, 'getERP5SiteGlobalId')
def getERP5SiteGlobalId(self): def getERP5SiteGlobalId(self):
"""Returns site global ID without any fallback""" """Returns site global ID without any fallback"""
......
...@@ -373,15 +373,10 @@ class FolderMixIn(ExtensionClass.Base): ...@@ -373,15 +373,10 @@ class FolderMixIn(ExtensionClass.Base):
In order to activate objects that don't inherit ActiveObject, In order to activate objects that don't inherit ActiveObject,
only placeless default activate parameters are taken into account. only placeless default activate parameters are taken into account.
""" """
portal = self.getPortalObject() activate_kw = self.getDefaultActivateParameterDict.im_func(None)
activate_kw = portal.getPlacelessDefaultActivateParameters()
if activate_kw:
activate_kw = activate_kw.copy()
else:
activate_kw = {}
activate_kw.update(kw.get('activate_kw', ())) activate_kw.update(kw.get('activate_kw', ()))
activate_kw.setdefault('active_process', None) activate_kw.setdefault('active_process', None)
activate = portal.portal_activities.activateObject activate = self.getPortalObject().portal_activities.activateObject
validate = restricted and getSecurityManager().validate validate = restricted and getSecurityManager().validate
cost = activate_kw.setdefault('group_method_cost', .034) # 30 objects cost = activate_kw.setdefault('group_method_cost', .034) # 30 objects
if cost != 1: if cost != 1:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment