# HG changeset patch
# User Arthur Lutz <arthur.lutz@logilab.fr>
# Date 1463750316 -7200
#      Fri May 20 15:18:36 2016 +0200
# Node ID 153925ddddc282528cf4285b2d775218872feca5
# Parent  fa1eb8746f3da9ddd5c98f9f2416977a1cc3f35d
[hooks] hack to avoid trying to index file type objects, the proper way will be in a new adapter

diff --git a/hooks.py b/hooks.py
--- a/hooks.py
+++ b/hooks.py
@@ -44,9 +44,12 @@
     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:
+            #serializer = self.entity.cw_adapt_to('IFTISerializable')
             serializer = self.entity.cw_adapt_to('ISerializable')
             json = serializer.serialize()
             es = Elasticsearch(locations and locations.split(','))