[server] remove some pre 3.10 compat

Let's assume nobody will try upgrading an instance from pre-3.10 cubicweb to 3.23+. If they do, they're setting themselves up for a lot of pain anyway.

authorSylvain Thénault <sylvain.thenault@logilab.fr>
changeset421520f4d516
branchdefault
phasepublic
hiddenno
parent revision#2dafcdd19c99 pep8 bits
child revision#b14885133f90 [test] Make sure that newcube command test produces expected files
files modified by this revision
cubicweb/server/sources/native.py
# HG changeset patch
# User Sylvain Thénault <sylvain.thenault@logilab.fr>
# Date 1454058275 -3600
# Fri Jan 29 10:04:35 2016 +0100
# Node ID 421520f4d5165fcfe5ee39706bdbc30534abcb54
# Parent 2dafcdd19c9918f6d0bde86b6afdcaf07c1722b3
[server] remove some pre 3.10 compat

Let's assume nobody will try upgrading an instance from pre-3.10
cubicweb to 3.23+. If they do, they're setting themselves up for a lot
of pain anyway.

diff --git a/cubicweb/server/sources/native.py b/cubicweb/server/sources/native.py
@@ -921,11 +921,11 @@
1                                           (entity.eid, entity.e_schema.eid))
2              for eschema in entity.e_schema.ancestors() + [entity.e_schema]:
3                  self._handle_is_relation_sql(cnx,
4                                               'INSERT INTO is_instance_of_relation(eid_from,eid_to) VALUES (%s,%s)',
5                                               (entity.eid, eschema.eid))
6 -        if 'CWSource' in self.schema and source.eid is not None: # else, cw < 3.10
7 +        if source.eid is not None:  # else the source has not yet been inserted
8              self._handle_is_relation_sql(cnx, 'INSERT INTO cw_source_relation(eid_from,eid_to) VALUES (%s,%s)',
9                                           (entity.eid, source.eid))
10          # now we can update the full text index
11          if self.need_fti_indexation(entity.cw_etype):
12              self.index_entity(cnx, entity=entity)