Switch to unified view

a/scripts/migrate_project_database.py b/scripts/migrate_project_database.py
...
...
28
28
29
def migrate_project_database(project):
29
def migrate_project_database(project):
30
    c.project = project
30
    c.project = project
31
    target_uri = M.Project.default_database_uri(project.shortname)
31
    target_uri = M.Project.default_database_uri(project.shortname)
32
    target_db = target_uri.rsplit('/')[-1]
32
    target_db = target_uri.rsplit('/')[-1]
33
    if project is None:
34
        log.fatal('Project %s not found', project.shortname)
35
        return 2
36
    if project.database_uri == target_uri:
33
    if project.database_uri == target_uri:
37
        log.info('Project %s is already migrated to %s', project.shortname, project.database_uri)
34
        log.info('Project %s is already migrated to %s', project.shortname, project.database_uri)
38
        return 2
35
        return 2
39
    conn = M.session.main_doc_session.db.connection
36
    conn = M.session.main_doc_session.db.connection
40
    host = '%s:%s' % (conn.host, conn.port)
37
    host = '%s:%s' % (conn.host, conn.port)