fix name can be absent in github data

https://sentry.io/organizations/son/issues/1201398007/?project=1478143&query=is%3Aunresolved
This commit is contained in:
Son NK 2019-11-17 11:32:51 +01:00
parent 673b9e72ee
commit c5b65c108b

View file

@ -88,7 +88,9 @@ def github_callback():
# create user # create user
else: else:
LOG.d("create github user") LOG.d("create github user")
user = User.create(email=email, name=github_user_data["name"], activated=True) user = User.create(
email=email, name=github_user_data.get("name") or "", activated=True
)
db.session.commit() db.session.commit()
login_user(user) login_user(user)
email_utils.send_welcome_email(user.email, user.name) email_utils.send_welcome_email(user.email, user.name)