ldap: fix use of LDAP not guarded by V5Config.USE_LDAP

This commit is contained in:
Lephe 2023-08-08 22:46:09 +02:00 committed by Eragon
parent 13c1b30ad6
commit 40a5d54c49
Signed by: Eragon
GPG Key ID: 087126EBFC725006
2 changed files with 4 additions and 2 deletions

View File

@ -43,7 +43,8 @@ def edit_account():
newsletter=form.newsletter.data,
theme=form.theme.data
)
ldap.edit(old_username, current_user)
if V5Config.USE_LDAP:
ldap.edit(old_username, current_user)
current_user.update(password=form.password.data or None)
db.session.merge(current_user)
db.session.commit()

View File

@ -64,7 +64,8 @@ def adm_edit_account(user_id):
newsletter=form.newsletter.data,
xp=form.xp.data or None,
)
ldap.edit(old_username, user)
if V5Config.USE_LDAP:
ldap.edit(old_username, user)
user.update(password=form.password.data or None)
db.session.merge(user)
db.session.commit()