--- a/src/pyams_content_es/index.py Thu Feb 08 08:52:49 2018 +0100
+++ b/src/pyams_content_es/index.py Sat Feb 17 15:58:52 2018 +0100
@@ -56,7 +56,10 @@
def handle_modified_document(event):
"""Handle modified document"""
document = event.object
- ITransactionManager(document).get().addAfterCommitHook(index_document, kws={'document': document})
+ transaction = ITransactionManager(document).get()
+ if 'pyams_content_es.index_document' not in transaction.extension:
+ transaction.addAfterCommitHook(index_document, kws={'document': document})
+ transaction.extension['pyams_content_es.index_document'] = True
@subscriber(IObjectRemovedEvent, context_selector=IDocumentIndexTarget)