diff --git a/migration/tables/users.py b/migration/tables/users.py index b30e82c8..53b574d9 100644 --- a/migration/tables/users.py +++ b/migration/tables/users.py @@ -35,11 +35,12 @@ def migrate(entry): slug = entry["profile"].get("path").lower() slug = re.sub('[^0-9a-zA-Z]+', '-', slug).strip() user_dict["slug"] = slug - bio = BeautifulSoup(entry.get("profile").get("bio") or "", features="lxml").text - if bio.startswith('<'): - print('[migration] bio! ' + bio) - bio = BeautifulSoup(bio, features="lxml").text - bio = bio.replace('\(', '(').replace('\)', ')') + bio = (entry.get("profile", {"bio": ""}).get("bio") or "").replace('\(', '(').replace('\)', ')') + bio_html = BeautifulSoup(bio, features="lxml").text + if bio == bio_html: + user_dict["bio"] = bio + else: + user_dict["about"] = bio # userpic try: diff --git a/orm/user.py b/orm/user.py index 2dc25b61..b8853f82 100644 --- a/orm/user.py +++ b/orm/user.py @@ -56,7 +56,8 @@ class User(Base): email = Column(String, unique=True, nullable=False, comment="Email") username = Column(String, nullable=False, comment="Login") password = Column(String, nullable=True, comment="Password") - bio = Column(String, nullable=True, comment="Bio") + bio = Column(String, nullable=True, comment="Bio") # status description + about = Column(String, nullable=True, comment="About") # long and formatted userpic = Column(String, nullable=True, comment="Userpic") name = Column(String, nullable=True, comment="Display name") slug = Column(String, unique=True, comment="User's slug")