From ce3f3339e9d80a8a5802a87457a9102110df546e Mon Sep 17 00:00:00 2001 From: tonyrewin Date: Sun, 3 Jul 2022 03:56:26 +0300 Subject: [PATCH] less bloat --- migration/tables/content_item_categories.py | 7 +------ migration/tables/tags.py | 5 ----- 2 files changed, 1 insertion(+), 11 deletions(-) diff --git a/migration/tables/content_item_categories.py b/migration/tables/content_item_categories.py index 5fd4b5e3..310fc231 100644 --- a/migration/tables/content_item_categories.py +++ b/migration/tables/content_item_categories.py @@ -39,16 +39,11 @@ def migrate(entry, topics_by_oid): else: if len(topic.title) > len(topic_dict['title']) or \ len(topic.body) < len(topic_dict['body']): - print('updating topic') topic.update({ 'slug': slug, 'title': topic_dict['title'] if len(topic.title) > len(topic_dict['title']) else topic.title, - 'body': topic_dict['body'] if len(topic.body) < len(topic_dict['body']) else topic.body, - #'views': topic.views + topic_dict['views'] - #'authors': topic.views + topic_dict['views'] - #'followers': topic.views + topic_dict['views'] + 'body': topic_dict['body'] if len(topic.body) < len(topic_dict['body']) else topic.body }) - print(slug + ': ' + topic.title) except Exception as e: print('not found old topic: ' + slug) else: diff --git a/migration/tables/tags.py b/migration/tables/tags.py index f89917de..8954a71d 100644 --- a/migration/tables/tags.py +++ b/migration/tables/tags.py @@ -39,11 +39,6 @@ def migrate(entry, topics_by_oid): if not topic: del topic_dict['oid'] topic = Topic.create(**topic_dict) - else: - print(slug + ': ' + topic.title) - else: - print('not found topic: ' + slug) - raise Exception except Exception as e: print(e) raise e