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
parent aa0fd2e46a
commit 53097ed162
Signed by: Lephenixnoir
GPG Key ID: 1BBA026E13FC0495
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()