membershipworks/ucsAccounts: Don't set email if empty in MembershipWorks

This commit is contained in:
Adam Goldsmith 2024-01-05 14:50:15 -05:00
parent da0767a0e9
commit 8e4353c925

View File

@ -90,13 +90,15 @@ async def sync_member(user_mod, member: Member):
# "userexpiry": member["Renewal Date"], # "userexpiry": member["Renewal Date"],
# "pwdChangeNextLogin": "1", # User has to change password on next login # "pwdChangeNextLogin": "1", # User has to change password on next login
# "sambaLogonHours": "", # Permitted times for Windows logins # "sambaLogonHours": "", # Permitted times for Windows logins
"e-mail": [member.email], # ([]) E-mail address
"phone": [member.phone], # Telephone number "phone": [member.phone], # Telephone number
# "PasswordRecoveryMobile": member["Phone"], # Mobile phone number # "PasswordRecoveryMobile": member["Phone"], # Mobile phone number
"PasswordRecoveryEmail": member.email,
} }
) )
if member.email:
user.props["e-mail"] = [member.email] # ([]) E-mail address
user.props["PasswordRecoveryEmail"] = member.email
new_groups = [ new_groups = [
f"cn={sanitize_group_name(flag.name)},{GROUP_BASE}" f"cn={sanitize_group_name(flag.name)},{GROUP_BASE}"
async for flag in member.flags.filter( async for flag in member.flags.filter(