bio fix
This commit is contained in:
parent
7969f67c67
commit
91abb07a07
|
@ -1,8 +1,8 @@
|
||||||
from dateutil.parser import parse
|
from dateutil.parser import parse
|
||||||
from sqlalchemy.exc import IntegrityError
|
from sqlalchemy.exc import IntegrityError
|
||||||
|
from bs4 import BeautifulSoup
|
||||||
|
|
||||||
from base.orm import local_session
|
from base.orm import local_session
|
||||||
from migration.html2text import html2text
|
|
||||||
from orm.user import AuthorFollower, User, UserRating
|
from orm.user import AuthorFollower, User, UserRating
|
||||||
|
|
||||||
|
|
||||||
|
@ -34,9 +34,8 @@ def migrate(entry):
|
||||||
user_dict["slug"] = (
|
user_dict["slug"] = (
|
||||||
entry["profile"].get("path").lower().replace(" ", "-").strip()
|
entry["profile"].get("path").lower().replace(" ", "-").strip()
|
||||||
)
|
)
|
||||||
user_dict["bio"] = html2text(
|
bio = BeautifulSoup(entry.get("profile").get("bio") or "").text
|
||||||
entry.get("profile").get("bio") or ""
|
bio = bio.replace('\(', '(').replace('\)', ')')
|
||||||
).replace('\(', '(').replace('\)', ')')
|
|
||||||
|
|
||||||
# userpic
|
# userpic
|
||||||
try:
|
try:
|
||||||
|
|
Loading…
Reference in New Issue
Block a user