From 2a97bdb2d41adfb73d1999c7b50b6abddcaf4796 Mon Sep 17 00:00:00 2001 From: Igor Lobanov Date: Wed, 4 Oct 2023 21:41:49 +0200 Subject: [PATCH] fixed html in bio/about --- migration/tables/users.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/migration/tables/users.py b/migration/tables/users.py index e269da28..dde3bca3 100644 --- a/migration/tables/users.py +++ b/migration/tables/users.py @@ -37,10 +37,12 @@ def migrate(entry): slug = re.sub('[^0-9a-zA-Z]+', '-', slug).strip() user_dict["slug"] = slug bio = (entry.get("profile", {"bio": ""}).get("bio") or "").replace('\(', '(').replace('\)', ')') - if len(bio) > 120: - user_dict["bio"] = bio + bio_text = BeautifulSoup(bio, features="lxml").text + + if len(bio_text) > 120: + user_dict["bio"] = bio_text else: - user_dict["about"] = bio + user_dict["about"] = bio_text # userpic try: