[dataimport] Correctly call rschema(rtype) in SqlGenObjectStore, closes #3694139

authorVincent Michel <vincent.michel@logilab.fr>
changeset8e9db17ce129
branchstable
phasepublic
hiddenno
parent revision#3000c57f1025 [pkg] prepare 3.18.4
child revision#7017188783d3 [pkg] bump cubicweb.spec
files modified by this revision
dataimport.py
# HG changeset patch
# User Vincent Michel <vincent.michel@logilab.fr>
# Date 1396264724 0
# Mon Mar 31 11:18:44 2014 +0000
# Branch stable
# Node ID 8e9db17ce1294a3ffdd5d10ddc99a5822db6a4b3
# Parent 3000c57f1025173b6b4bbdfcc09411156bf36376
[dataimport] Correctly call rschema(rtype) in SqlGenObjectStore, closes #3694139

diff --git a/dataimport.py b/dataimport.py
@@ -800,11 +800,11 @@
1 
2      def relate(self, eid_from, rtype, eid_to, **kwargs):
3          assert not rtype.startswith('reverse_')
4          self.add_relation(self.session, eid_from, rtype, eid_to,
5                            self.rschema(rtype).inlined)
6 -        if self.rschema[rtype].symmetric:
7 +        if self.rschema(rtype).symmetric:
8              self.add_relation(self.session, eid_to, rtype, eid_from,
9                                self.rschema(rtype).inlined)
10          self._nb_inserted_relations += 1
11 
12      @property
@@ -929,11 +929,11 @@
13          if subj_eid is None or obj_eid is None:
14              return
15          # XXX Could subjtype be inferred ?
16          self.source.add_relation(self.session, subj_eid, rtype, obj_eid,
17                                   self.rschema(rtype).inlined, **kwargs)
18 -        if self.rschema[rtype].symmetric:
19 +        if self.rschema(rtype).symmetric:
20              self.source.add_relation(self.session, obj_eid, rtype, subj_eid,
21                                       self.rschema(rtype).inlined, **kwargs)
22 
23      def drop_indexes(self, etype):
24          """Drop indexes for a given entity type"""