Commit fae36b4d authored by Iliya Manolov's avatar Iliya Manolov

Added a check that can exclude objects from being reindexed.

parent 9d47a8ce
...@@ -2839,10 +2839,20 @@ class Base( CopyContainer, ...@@ -2839,10 +2839,20 @@ class Base( CopyContainer,
security.declarePublic('reindexObject') security.declarePublic('reindexObject')
def reindexObject(self, *args, **kw): def reindexObject(self, *args, **kw):
""" """
Reindexes an object Reindexes an object. If you want to exclude your ERP5 object from
reindexing, add it to the 'explicitly_deny_object_reindexation_list'
element in your transaction variables.
args / kw required since we must follow API args / kw required since we must follow API
""" """
self._reindexObject(*args, **kw) transactional_variable = getTransactionalVariable()
try:
no_reindex = transactional_variable['explicitly_deny_object_reindexation_list']
except KeyError:
no_reindex = []
if not self in no_reindex:
self._reindexObject(*args, **kw)
def _reindexObject(self, activate_kw=None, **kw): def _reindexObject(self, activate_kw=None, **kw):
# When the activity supports group methods, portal_catalog/catalogObjectList is called instead of # When the activity supports group methods, portal_catalog/catalogObjectList is called instead of
......
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