diff --git a/auth/email.py b/auth/email.py index bbccd6e6..5be246e1 100644 --- a/auth/email.py +++ b/auth/email.py @@ -19,7 +19,7 @@ def load_email_templates(): filename = "templates/%s.tmpl" % name with open(filename) as f: email_templates[name] = f.read() - print("all email templates loaded") + print("[email.service] templates loaded") async def send_confirm_email(user): text = email_templates["confirm_email"] diff --git a/migration/tables/content_item_categories.py b/migration/tables/content_item_categories.py index 1d72a2c4..5fd4b5e3 100644 --- a/migration/tables/content_item_categories.py +++ b/migration/tables/content_item_categories.py @@ -29,6 +29,7 @@ def migrate(entry, topics_by_oid): with local_session() as session: slug = topics_by_oid.get(topic_dict['oid'], topic_dict)['slug'] if slug: + slug = retopics.get(slug, slug) try: topic = session.query(Topic).filter(Topic.slug == slug).first() if not topic: diff --git a/migration/tables/content_items.py b/migration/tables/content_items.py index ffe5014f..94b30f82 100644 --- a/migration/tables/content_items.py +++ b/migration/tables/content_items.py @@ -263,9 +263,9 @@ def migrate(entry, users_by_oid, topics_by_oid): shout_dict['topics'] = [] for topic in r['topics']: try: - ShoutTopic.create(**{ 'shout': s.slug, 'topic': topic['slug'] }) tpc = topics_by_oid[topic['oid']] slug = retopics.get(tpc['slug'], tpc['slug']) + ShoutTopic.create(**{ 'shout': s.slug, 'topic': slug }) shout_dict['topics'].append(slug) except sqlalchemy.exc.IntegrityError: pass diff --git a/migration/tables/tags.py b/migration/tables/tags.py index 6ef94288..f89917de 100644 --- a/migration/tables/tags.py +++ b/migration/tables/tags.py @@ -33,6 +33,7 @@ def migrate(entry, topics_by_oid): retopics = json.loads(open('migration/tables/replacements.json').read()) with local_session() as session: slug = topics_by_oid.get(topic_dict['oid'], topic_dict)['slug'] + slug = retopics.get(slug, slug) if slug: topic = session.query(Topic).filter(Topic.slug == slug).first() if not topic: