cubicweb/server/__init__.py
changeset 11129 97095348b3ee
parent 11090 b4b854c25de5
parent 11057 0b59724cb3f2
child 11413 c172fa18565e
equal deleted inserted replaced
11128:9b4de34ad394 11129:97095348b3ee
   295         cnx.commit()
   295         cnx.commit()
   296     repo.shutdown()
   296     repo.shutdown()
   297     # re-login using the admin user
   297     # re-login using the admin user
   298     config._cubes = None # avoid assertion error
   298     config._cubes = None # avoid assertion error
   299     repo = get_repository(config=config)
   299     repo = get_repository(config=config)
       
   300     # replace previous schema by the new repo's one. This is necessary so that we give the proper
       
   301     # schema to `initialize_schema` above since it will initialize .eid attribute of schema elements
       
   302     schema = repo.schema
   300     with connect(repo, login, password=pwd) as cnx:
   303     with connect(repo, login, password=pwd) as cnx:
   301         with cnx.security_enabled(False, False):
   304         with cnx.security_enabled(False, False):
   302             repo.system_source.eid = ssource.eid # redo this manually
   305             repo.system_source.eid = ssource.eid # redo this manually
   303             handler = config.migration_handler(schema, interactive=False,
   306             handler = config.migration_handler(schema, interactive=False,
   304                                                cnx=cnx, repo=repo)
   307                                                cnx=cnx, repo=repo)