# HG changeset patch # User Sylvain Thénault # Date 1454058396 -3600 # Node ID 731d217e4a311ddd408fdc11387230a678104419 # Parent b62b9d78b533ece782f15eef39c0fde68f68cf85 [dataimport] simplify SQLGenSourceWrapper.add_info At this point 'CWSource' is a thing (we're not in the middle of a migration), and source.eid won't be None (we read it from the db) diff -r b62b9d78b533 -r 731d217e4a31 dataimport/pgstore.py --- a/dataimport/pgstore.py Mon Feb 01 15:10:35 2016 +0100 +++ b/dataimport/pgstore.py Fri Jan 29 10:06:36 2016 +0100 @@ -436,9 +436,8 @@ self._handle_is_relation_sql(cnx, 'INSERT INTO is_instance_of_relation(eid_from,eid_to) VALUES (%s,%s)', (entity.eid, eschema_eid(cnx, eschema))) - if 'CWSource' in self.schema and source.eid is not None: # else, cw < 3.10 - self._handle_is_relation_sql(cnx, 'INSERT INTO cw_source_relation(eid_from,eid_to) VALUES (%s,%s)', - (entity.eid, source.eid)) + self._handle_is_relation_sql(cnx, 'INSERT INTO cw_source_relation(eid_from,eid_to) VALUES (%s,%s)', + (entity.eid, source.eid)) # now we can update the full text index if self.do_fti and self.need_fti_indexation(entity.cw_etype): self.index_entity(cnx, entity=entity)