Switch to unified view

a/scripts/teamforge-import.py b/scripts/teamforge-import.py
...
...
484
                        # running with this new code against an existing import
484
                        # running with this new code against an existing import
485
                        # that didn't have import_ids
485
                        # that didn't have import_ids
486
                        thread_query['import_id'] = topic_data.id
486
                        thread_query['import_id'] = topic_data.id
487
                    to = DM.ForumThread.query.get(**thread_query)
487
                    to = DM.ForumThread.query.get(**thread_query)
488
                    if not to:
488
                    if not to:
489
                        to = DM.ForumThread(
489
                        to = DM.ForumThread.new(
490
                            subject=topic_data.title,
490
                            subject=topic_data.title,
491
                            discussion_id=fo._id,
491
                            discussion_id=fo._id,
492
                            import_id=topic_data.id,
492
                            import_id=topic_data.id,
493
                            app_config_id=discuss_app.config._id)
493
                            app_config_id=discuss_app.config._id)
494
                    to.import_id=topic_data.id
494
                    to.import_id=topic_data.id
...
...
564
                if not p.slug:
564
                if not p.slug:
565
                    p.make_slug()
565
                    p.make_slug()
566
                if not p.history().first():
566
                if not p.history().first():
567
                    p.commit()
567
                    p.commit()
568
                    ThreadLocalORMSession.flush_all()
568
                    ThreadLocalORMSession.flush_all()
569
                    M.Thread(discussion_id=p.app_config.discussion_id,
569
                    M.Thread.new(discussion_id=p.app_config.discussion_id,
570
                           ref_id=p.index_id(),
570
                           ref_id=p.index_id(),
571
                           subject='%s discussion' % p.title)
571
                           subject='%s discussion' % p.title)
572
                user = get_user(post_data.createdByUsername)
572
                user = get_user(post_data.createdByUsername)
573
                p.history().first().author=dict(
573
                p.history().first().author=dict(
574
                    id=user._id,
574
                    id=user._id,