# HG changeset patch # User Sylvain Thénault # Date 1273589915 -7200 # Node ID 3679015c0a50bfaae650115476f4a5098b617d22 # Parent 07b32d9d8804c639ca44ff35f3d65bc7536283f6 [fti] simplify UpdateFTIHook code diff -r 07b32d9d8804 -r 3679015c0a50 hooks/metadata.py --- a/hooks/metadata.py Tue May 11 16:48:26 2010 +0200 +++ b/hooks/metadata.py Tue May 11 16:58:35 2010 +0200 @@ -160,18 +160,10 @@ rtype = self.rtype session = self._cw ftcontainer = session.vreg.schema.rschema(rtype).fulltext_container - if self.event == 'after_add_relation': - if ftcontainer == 'subject': - session.repo.system_source.index_entity( - session, session.entity_from_eid(self.eidfrom)) - elif ftcontainer == 'object': - session.repo.system_source.index_entity( - session, session.entity_from_eid(self.eidto)) - # after delete relation - elif ftcontainer == 'subject': + if ftcontainer == 'subject': session.repo.system_source.index_entity( - session, entity=session.entity_from_eid(self.eidfrom)) + session, session.entity_from_eid(self.eidfrom)) elif ftcontainer == 'object': session.repo.system_source.index_entity( - session, entity=session.entity_from_eid(self.eidto)) + session, session.entity_from_eid(self.eidto))