From 2879ee9a7aeacff9d1b568f087e46f1dd5aecc97 Mon Sep 17 00:00:00 2001 From: Adam Goldsmith Date: Fri, 5 Jan 2024 14:50:15 -0500 Subject: [PATCH] membershipworks/ucsAccounts: Don't set email if empty in MembershipWorks --- membershipworks/tasks/ucsAccounts.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/membershipworks/tasks/ucsAccounts.py b/membershipworks/tasks/ucsAccounts.py index 14e642b..409ef1d 100644 --- a/membershipworks/tasks/ucsAccounts.py +++ b/membershipworks/tasks/ucsAccounts.py @@ -90,13 +90,15 @@ async def sync_member(user_mod, member: Member): # "userexpiry": member["Renewal Date"], # "pwdChangeNextLogin": "1", # User has to change password on next login # "sambaLogonHours": "", # Permitted times for Windows logins - "e-mail": [member.email], # ([]) E-mail address "phone": [member.phone], # Telephone number # "PasswordRecoveryMobile": member["Phone"], # Mobile phone number "PasswordRecoveryEmail": member.email, } ) + if member.email: + user.props["e-mail"] = [member.email] # ([]) E-mail address + new_groups = [ f"cn={sanitize_group_name(flag.name)},{GROUP_BASE}" async for flag in member.flags.filter(