This commit is contained in:
2022-11-19 14:35:34 +03:00
parent 57e1460356
commit 47b285f8ac
18 changed files with 162 additions and 218 deletions

View File

@@ -1,6 +1,6 @@
from base.orm import local_session
from migration.extract import extract_md, html2text
from orm import Topic, Community
from orm import Topic
def migrate(entry):
@@ -8,9 +8,7 @@ def migrate(entry):
topic_dict = {
"slug": entry["slug"],
"oid": entry["_id"],
"title": entry["title"].replace(" ", " "),
"children": [],
"community": Community.default_community.slug,
"title": entry["title"].replace(" ", " ")
}
topic_dict["body"] = extract_md(html2text(body_orig), entry["_id"])
with local_session() as session: