[dataimport] Fix rdef loopup in importer
authorSylvain Thénault <sylvain.thenault@logilab.fr>
Thu, 23 Jun 2016 10:24:11 +0200
changeset 11353 98edb500806f
parent 11352 7844973fe3e0
child 11354 6b7f4c6745a0
[dataimport] Fix rdef loopup in importer
cubicweb/dataimport/importer.py
--- a/cubicweb/dataimport/importer.py	Wed Jun 22 16:23:11 2016 +0200
+++ b/cubicweb/dataimport/importer.py	Thu Jun 23 10:24:11 2016 +0200
@@ -216,7 +216,7 @@
                     if (rschema.final and eschema.has_metadata(rtype, 'format')
                             and not rtype + '_format' in entity_dict):
                         entity_dict[rtype + '_format'] = u'text/plain'
-                    if rschema.final and rschema.objects()[0].type == 'Bytes':
+                    if rschema.final and eschema.rdef(rtype).object.type == 'Bytes':
                         entity_dict[rtype] = Binary(entity_dict[rtype])
                 else:
                     del entity_dict[key]