about/bio
This commit is contained in:
parent
11655b31ae
commit
ca6fc3c32d
|
@ -35,11 +35,12 @@ def migrate(entry):
|
||||||
slug = entry["profile"].get("path").lower()
|
slug = entry["profile"].get("path").lower()
|
||||||
slug = re.sub('[^0-9a-zA-Z]+', '-', slug).strip()
|
slug = re.sub('[^0-9a-zA-Z]+', '-', slug).strip()
|
||||||
user_dict["slug"] = slug
|
user_dict["slug"] = slug
|
||||||
bio = BeautifulSoup(entry.get("profile").get("bio") or "", features="lxml").text
|
bio = (entry.get("profile", {"bio": ""}).get("bio") or "").replace('\(', '(').replace('\)', ')')
|
||||||
if bio.startswith('<'):
|
bio_html = BeautifulSoup(bio, features="lxml").text
|
||||||
print('[migration] bio! ' + bio)
|
if bio == bio_html:
|
||||||
bio = BeautifulSoup(bio, features="lxml").text
|
user_dict["bio"] = bio
|
||||||
bio = bio.replace('\(', '(').replace('\)', ')')
|
else:
|
||||||
|
user_dict["about"] = bio
|
||||||
|
|
||||||
# userpic
|
# userpic
|
||||||
try:
|
try:
|
||||||
|
|
|
@ -56,7 +56,8 @@ class User(Base):
|
||||||
email = Column(String, unique=True, nullable=False, comment="Email")
|
email = Column(String, unique=True, nullable=False, comment="Email")
|
||||||
username = Column(String, nullable=False, comment="Login")
|
username = Column(String, nullable=False, comment="Login")
|
||||||
password = Column(String, nullable=True, comment="Password")
|
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")
|
userpic = Column(String, nullable=True, comment="Userpic")
|
||||||
name = Column(String, nullable=True, comment="Display name")
|
name = Column(String, nullable=True, comment="Display name")
|
||||||
slug = Column(String, unique=True, comment="User's slug")
|
slug = Column(String, unique=True, comment="User's slug")
|
||||||
|
|
Loading…
Reference in New Issue
Block a user