server/migractions.py
branchstable
changeset 7780 a1d5365fefc1
parent 7562 cdef82ca9eab
child 7782 40a49f4350a5
--- a/server/migractions.py	Tue Sep 13 14:41:53 2011 +0200
+++ b/server/migractions.py	Tue Sep 13 14:48:24 2011 +0200
@@ -117,7 +117,15 @@
             # which is called on regular start
             repo.hm.call_hooks('server_maintenance', repo=repo)
         if not schema and not getattr(config, 'quick_start', False):
-            schema = config.load_schema(expand_cubes=True)
+            insert_lperms = self.repo.get_versions()['cubicweb'] < (3, 14, 0) and 'localperms' in config.available_cubes()
+            if insert_lperms:
+                cubes = config._cubes
+                config._cubes += ('localperms',)
+            try:
+                schema = config.load_schema(expand_cubes=True)
+            finally:
+                if insert_lperms:
+                    config._cubes = cubes
         self.fs_schema = schema
         self._synchronized = set()