Skip to content
Snippets Groups Projects
Commit 153925ddddc2 authored by Arthur Lutz's avatar Arthur Lutz
Browse files

[hooks] hack to avoid trying to index file type objects, the proper way will be in a new adapter

parent fa1eb8746f3d
No related branches found
No related tags found
No related merge requests found
......@@ -44,6 +44,8 @@
category = 'es'
def __call__(self):
if self.entity.cw_etype == 'File':
return # FIXME hack!
locations = self._cw.vreg.config['elasticsearch-locations']
index_name = self._cw.vreg.config['index-name']
if locations and index_name:
......@@ -47,6 +49,7 @@
locations = self._cw.vreg.config['elasticsearch-locations']
index_name = self._cw.vreg.config['index-name']
if locations and index_name:
#serializer = self.entity.cw_adapt_to('IFTISerializable')
serializer = self.entity.cw_adapt_to('ISerializable')
json = serializer.serialize()
es = Elasticsearch(locations and locations.split(','))
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment