[PATCH skos] [dataimport] fix CubicWeb 3.25 compatibility

Philippe Pepiot philippe.pepiot at logilab.fr
Tue Mar 21 11:02:23 CET 2017


# HG changeset patch
# User Philippe Pepiot <philippe.pepiot at logilab.fr>
# Date 1490090259 -3600
#      Tue Mar 21 10:57:39 2017 +0100
# Node ID 0981f91a589d71344481da0e874598bcdb2dbf70
# Parent  3f2be8f07627ccc45a4441d3e9ecaea79240bbc2
# Available At https://hg.logilab.org/review/cubes/skos
#              hg pull https://hg.logilab.org/review/cubes/skos -r 0981f91a589d
# Tested at: https://jenkins.logilab.org/job/cubicweb-skos/25/
[dataimport] fix CubicWeb 3.25 compatibility

cnx.session is gone with CubicWeb 3.25, use vreg to get the schema instead.

diff --git a/post321_import.py b/post321_import.py
--- a/post321_import.py
+++ b/post321_import.py
@@ -103,7 +103,7 @@ def store_skos_extentities(cnx, store, e
     entities = imap(record_scheme, entities)
     etypes_order_hint = ('ConceptScheme', 'Concept', 'Label')
     existing_relations = SKOSRelationMapping(cnx, source)
-    importer = SKOSExtEntitiesImporter(schema=cnx.session.repo.schema, store=store,
+    importer = SKOSExtEntitiesImporter(schema=cnx.vreg.schema, store=store,
                                        extid2eid=extid2eid, existing_relations=existing_relations,
                                        restore_relations=restore_relations,
                                        etypes_order_hint=etypes_order_hint, import_log=import_log,



More information about the saem-devel mailing list