[migration] Fix 0.11 migration when used in the context of saem
authorSylvain Thénault <sylvain.thenault@logilab.fr>
Fri, 13 Oct 2017 17:53:11 +0200
changeset 2770 80fcf3c946c7
parent 2769 11e0b8fc9c57
child 2771 aa91a791182e
[migration] Fix 0.11 migration when used in the context of saem
cubicweb_seda/migration/0.11.0_Any.py
--- a/cubicweb_seda/migration/0.11.0_Any.py	Fri Oct 13 15:52:24 2017 +0200
+++ b/cubicweb_seda/migration/0.11.0_Any.py	Fri Oct 13 17:53:11 2017 +0200
@@ -1,4 +1,13 @@
 from __future__ import print_function
+from cubicweb_seda.dataimport import LCSV_FILES, import_seda_schemes
+
+# please close your eyes - this is necessary if seda is used by saem else call
+# to import_seda_schemes will fail because it will attempt to reuse and existing
+# uri. Should be done there but still easier here.
+try:
+    from cubicweb_saem_ref.site_cubicweb import init_seda_scheme
+except ImportError:
+    init_seda_scheme.func_defaults[0][0] = len(LCSV_FILES) - 1
 
 print('filtering language concepts, this will take a while')