Commit fae36b4d authored by Iliya Manolov's avatar Iliya Manolov

Added a check that can exclude objects from being reindexed.

parent 9d47a8ce
......@@ -2839,9 +2839,19 @@ class Base( CopyContainer,
security.declarePublic('reindexObject')
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
"""
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):
......
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