# HG changeset patch # User Samuel Trégouët <samuel.tregouet@logilab.fr> # Date 1490859422 -7200 # Thu Mar 30 09:37:02 2017 +0200 # Node ID 9e877d975a94509f3c6a22e9e0d7d033e0a56589 # Parent f055f148f84e3a02a040e7d47d3f4cee0adaa041 [hook] use `serializer.doc_type` if exists (closes #17069804) let serializer decide if cw_etype and doc_type is different diff --git a/hooks.py b/hooks.py --- a/hooks.py +++ b/hooks.py @@ -98,7 +98,7 @@ # IFullTextIndex serializer, therefore the "id" and "doc_type" in # kwargs below must be container data. kwargs['id'] = json['eid'] - kwargs['doc_type'] = json['cw_etype'] + kwargs['doc_type'] = getattr(serializer, 'doc_type', json['cw_etype']) if json.get('parent'): kwargs['parent'] = json.pop('parent') else: # TODO only for types that have parents