Switch to unified view

a/scripts/teamforge-import.py b/scripts/teamforge-import.py
...
...
268
            continue
268
            continue
269
        user = get_user(member.userName)
269
        user = get_user(member.userName)
270
        pr = user.project_role(project)
270
        pr = user.project_role(project)
271
        pr.roles = [ role_developer._id ]
271
        pr.roles = [ role_developer._id ]
272
        ThreadLocalORMSession.flush_all()
272
        ThreadLocalORMSession.flush_all()
273
    project.labels = [cat.path.lstrip('projects/categorization.root.') for cat in data.categories]
273
    project.labels = [cat.path.split('projects/categorization.root.')[1] for cat in data.categories]
274
    icon_file = 'emsignia-MOBILITY-red.png'
275
    if 'nsn' in project.labels or 'msi' in project.labels:
276
        icon_file = 'emsignia-SOLUTIONS-blue.gif'
277
    if project.icon:
278
        M.ProjectFile.remove(dict(project_id=project._id, category='icon'))
279
    with open(os.path.join('..','scripts',icon_file)) as fp:
280
        M.ProjectFile.save_image(
281
            icon_file, fp, content_type=utils.guess_mime_type(icon_file),
282
            square=True, thumbnail_size=(48,48),
283
            thumbnail_meta=dict(project_id=project._id,category='icon'))
274
    ThreadLocalORMSession.flush_all()
284
    ThreadLocalORMSession.flush_all()
275
285
276
    dirs = os.listdir(os.path.join(options.output_dir, pid))
286
    dirs = os.listdir(os.path.join(options.output_dir, pid))
277
287
278
    frs_mapping = loadjson(pid, 'frs_mapping.json')
288
    frs_mapping = loadjson(pid, 'frs_mapping.json')