migration-bio-fix

This commit is contained in:
tonyrewin 2022-11-18 08:52:26 +03:00
parent 0d24193c3d
commit 8975e003a9
3 changed files with 4 additions and 2 deletions

View File

@ -295,7 +295,8 @@ def create_pgdump():
subprocess.call( subprocess.call(
["pg_dump", pgurl, "-f", TODAY + "-pgdump.sql"], stderr=subprocess.STDOUT ["pg_dump", pgurl, "-f", TODAY + "-pgdump.sql"], stderr=subprocess.STDOUT
) )
subprocess.call(["scp", TODAY + "-pgdump.sql", "root@build.discours.io:/root/."]) # manually then subprocess.call(["scp", TODAY + "-pgdump.sql", "root@v2.discours.io:/root/."]) # manually then
subprocess.call(["scp", TODAY + "-pgdump.sql", "root@testapi.discours.io:/root/."]) # manually then
async def handle_auto(): async def handle_auto():

View File

@ -524,6 +524,7 @@
"pandemiya": "pandemic", "pandemiya": "pandemic",
"parizh": "paris", "parizh": "paris",
"patriotizm": "patriotism", "patriotizm": "patriotism",
"patsifizm": "pacifism",
"paul-tselan": "paul-tselan", "paul-tselan": "paul-tselan",
"per-burd": "pierre-bourdieu", "per-burd": "pierre-bourdieu",
"perezhivaniya": "worries", "perezhivaniya": "worries",

View File

@ -34,7 +34,7 @@ def migrate(entry):
user_dict["slug"] = ( user_dict["slug"] = (
entry["profile"].get("path").lower().replace(" ", "-").strip() entry["profile"].get("path").lower().replace(" ", "-").strip()
) )
bio = BeautifulSoup(entry.get("profile").get("bio") or "").text bio = BeautifulSoup(entry.get("profile").get("bio") or "", features="lxml").text
bio = bio.replace('\(', '(').replace('\)', ')') bio = bio.replace('\(', '(').replace('\)', ')')
# userpic # userpic