migration-email-confirm-fix

This commit is contained in:
2022-11-16 12:23:32 +03:00
parent 803be4ceee
commit f0796cb939
3 changed files with 13 additions and 4 deletions

View File

@@ -149,6 +149,12 @@ async def migrate(entry, storage):
if entry.get("published"):
r["publishedAt"] = date_parse(entry.get("publishedAt", OLD_DATE))
r["visibility"] = "public"
with local_session() as session:
# update user.emailConfirmed if published
author = session.query(User).where(User.slug == userslug).first()
author.emailConfirmed = True
session.add(author)
session.commit()
else:
r["visibility"] = "authors"
if "deletedAt" in entry: