Commit 9498b936 authored by Jérome Perrin's avatar Jérome Perrin

drop support for immediate_reindex=True in newContent. Immediate reindexing is

a coding crime, we should not have an API for that.


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@34788 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 3adbb375
...@@ -1226,7 +1226,7 @@ class ERP5Site(FolderMixIn, CMFSite): ...@@ -1226,7 +1226,7 @@ class ERP5Site(FolderMixIn, CMFSite):
return None return None
security.declareProtected(Permissions.AddPortalContent, 'newContent') security.declareProtected(Permissions.AddPortalContent, 'newContent')
def newContent(self, id=None, portal_type=None, immediate_reindex=0, **kw): def newContent(self, id=None, portal_type=None, **kw):
""" """
Creates a new content Creates a new content
""" """
...@@ -1240,10 +1240,8 @@ class ERP5Site(FolderMixIn, CMFSite): ...@@ -1240,10 +1240,8 @@ class ERP5Site(FolderMixIn, CMFSite):
) # **kw) removed due to CMF bug ) # **kw) removed due to CMF bug
new_instance = self[id] new_instance = self[id]
if kw is not None: if kw:
new_instance._edit(force_update=1, **kw) new_instance._edit(force_update=1, **kw)
if immediate_reindex:
new_instance.immediateReindexObject()
return new_instance return new_instance
security.declarePublic('getVisibleAllowedContentTypeList') security.declarePublic('getVisibleAllowedContentTypeList')
......
...@@ -112,9 +112,9 @@ class FolderMixIn(ExtensionClass.Base): ...@@ -112,9 +112,9 @@ class FolderMixIn(ExtensionClass.Base):
security.declarePublic('newContent') security.declarePublic('newContent')
def newContent(self, id=None, portal_type=None, id_group=None, def newContent(self, id=None, portal_type=None, id_group=None,
default=None, method=None, immediate_reindex=0, default=None, method=None, container=None, created_by_builder=0,
container=None, created_by_builder=0, activate_kw=None, activate_kw=None, is_indexable=None, temp_object=0, reindex_kw=None,
is_indexable=None, temp_object=0, reindex_kw=None, **kw): **kw):
"""Creates a new content. """Creates a new content.
This method is public, since TypeInformation.constructInstance will perform This method is public, since TypeInformation.constructInstance will perform
the security check. the security check.
...@@ -167,8 +167,8 @@ class FolderMixIn(ExtensionClass.Base): ...@@ -167,8 +167,8 @@ class FolderMixIn(ExtensionClass.Base):
# ERP5TypeInformation, because factory method often do not support # ERP5TypeInformation, because factory method often do not support
# keywords arguments. # keywords arguments.
if kw != {} : new_instance._edit(force_update=1, **kw) if kw:
if immediate_reindex: new_instance.immediateReindexObject() new_instance._edit(force_update=1, **kw)
return new_instance return new_instance
security.declareProtected( security.declareProtected(
......
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