cubicweb/server/__init__.py
changeset 11129 97095348b3ee
parent 11090 b4b854c25de5
parent 11057 0b59724cb3f2
child 11413 c172fa18565e
--- a/cubicweb/server/__init__.py	Thu Feb 11 21:59:49 2016 +0100
+++ b/cubicweb/server/__init__.py	Wed Feb 17 13:45:34 2016 +0100
@@ -297,6 +297,9 @@
     # re-login using the admin user
     config._cubes = None # avoid assertion error
     repo = get_repository(config=config)
+    # replace previous schema by the new repo's one. This is necessary so that we give the proper
+    # schema to `initialize_schema` above since it will initialize .eid attribute of schema elements
+    schema = repo.schema
     with connect(repo, login, password=pwd) as cnx:
         with cnx.security_enabled(False, False):
             repo.system_source.eid = ssource.eid # redo this manually