fix(users): Update hook needs to check existence of display_name as well

This commit is contained in:
Ferdinand Thiessen 2021-12-01 15:19:29 +01:00
parent 45d15b4f88
commit e4a10028b7
1 changed files with 2 additions and 0 deletions

View File

@ -78,6 +78,8 @@ def reset_password(token: str, password: str):
@Hook
def update_user(user):
current_app.config["FG_AUTH_BACKEND"].update_user(user)
if not user.display_name:
user.display_name = "{} {}.".format(user.firstname, user.lastname[0])
db.session.commit()