fix(users): Update hook needs to check existence of display_name as well
This commit is contained in:
parent
45d15b4f88
commit
e4a10028b7
|
@ -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()
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue