fix set_schema/init_cubes order
authorSylvain Thénault <sylvain.thenault@logilab.fr>
Mon, 17 Aug 2009 18:35:09 +0200
changeset 2881 d1a5b77e42bc
parent 2880 bfc8e1831290
child 2882 d7f0646c65f7
fix set_schema/init_cubes order
server/repository.py
--- a/server/repository.py	Mon Aug 17 18:25:57 2009 +0200
+++ b/server/repository.py	Mon Aug 17 18:35:09 2009 +0200
@@ -236,6 +236,8 @@
             source.set_schema(schema)
         self.schema = schema
         if resetvreg:
+            if self.config._cubes is None:
+                self.config.init_cubes(self.get_cubes())
             # full reload of all appobjects
             self.vreg.reset()
             self.vreg.set_schema(schema)
@@ -262,7 +264,6 @@
         finally:
             session.close()
         self.set_schema(appschema)
-        self.config.init_cubes(self.get_cubes())
 
     def start_looping_tasks(self):
         assert isinstance(self._looping_tasks, list), 'already started'