Commit a9606fa6 authored by Yoshinori Okuji's avatar Yoshinori Okuji

Commit a transaction immediately if portal_activities is not installed.


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@376 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent d1de305a
......@@ -42,7 +42,7 @@ class ActiveObject(ExtensionClass.Base):
security = ClassSecurityInfo()
def activate(self, activity=DEFAULT_ACTIVITY, active_process=None, **kw):
def activate(self, activity=DEFAULT_ACTIVITY, active_process=None, passive_commit=0, **kw):
activity_tool = getattr(self, 'portal_activities', None)
if activity_tool is None: return self # Do nothing if no portal_activities
# activate returns an ActiveWrapper
......@@ -56,6 +56,7 @@ class ActiveObject(ExtensionClass.Base):
LOG("WARNING CMFActivity:",0, 'could not create activity for %s' % self.getRelativeUrl())
# If the portal_activities were not created
# return a passive object
if passive_commit: get_transaction().commit()
return self
security.declareProtected( CMFCorePermissions.ModifyPortalContent, 'hasActivity' )
......
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