From 3864ea057639ce01ba4949f9769d577430449743 Mon Sep 17 00:00:00 2001 From: Untone Date: Sun, 31 Oct 2021 11:35:47 +0300 Subject: [PATCH] migration fixes --- migrate.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/migrate.py b/migrate.py index e728fb63..d96712a0 100644 --- a/migrate.py +++ b/migrate.py @@ -126,7 +126,7 @@ if __name__ == '__main__': counter = 0 for cat in cats_data: old_id = cat["createdBy"] - cat["createdBy"] = user_id_map[old_id] + # cat["createdBy"] = user_id_map[old_id] try: topic = migrateCategory(cat) except Exception as e: raise e topics_by_cat[topic['cat_id']] = topic @@ -139,7 +139,7 @@ if __name__ == '__main__': topics_by_tag[topic['tag_id']] = topic if not topics_by_slug.get(topic['slug']): topics_by_slug[topic['slug']] = topic counter += 1 - export_topics = dict(sorted(topics_by_slug.items(), key=lambda item: str(item[1]['createdAt']))) # NOTE: sorting does not work :) + export_topics = dict(topics_by_slug.items()) # sorted(topics_by_slug.items(), key=lambda item: str(item[1]['createdAt']))) # NOTE: sorting does not work :) open('migration/data/topics.slug.json','w').write(json.dumps(topics_by_slug, cls=DateTimeEncoder, indent=4,