From 25e23ce96396167a91150bdfe37f782a3e1294fc Mon Sep 17 00:00:00 2001 From: axolotle Date: Sat, 25 Nov 2023 21:39:31 +0100 Subject: [PATCH] portal: reflect changes of splitting user form into info and password --- src/portal.py | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/src/portal.py b/src/portal.py index ece555cd5..190d21e20 100644 --- a/src/portal.py +++ b/src/portal.py @@ -221,7 +221,6 @@ def portal_update( ] if newpassword: - # FIXME: this ldap stuff should be handled in utils/ldap.py imho ? # Check that current password is valid @@ -257,9 +256,11 @@ def portal_update( # FIXME: Here we could want to trigger "post_user_update" hook but hooks has to # be run as root - - return { - "fullname": new_attr_dict["cn"][0], - "mailalias": new_attr_dict["mail"][1:], - "mailforward": new_attr_dict["maildrop"][1:], - } + if all(field is not None for field in (fullname, mailalias, mailforward)): + return { + "fullname": new_attr_dict["cn"][0], + "mailalias": new_attr_dict["mail"][1:], + "mailforward": new_attr_dict["maildrop"][1:], + } + else: + return {}