fix: set raw_mail to None when AD mail is empty [] instead of string
This commit is contained in:
@@ -149,7 +149,9 @@ def get_ad_user_info(user_id: str) -> dict | None:
|
|||||||
entry = entries[0]
|
entry = entries[0]
|
||||||
cn = str(entry.cn)
|
cn = str(entry.cn)
|
||||||
raw_mail = str(entry.mail) if 'mail' in entry else ""
|
raw_mail = str(entry.mail) if 'mail' in entry else ""
|
||||||
mail = raw_mail if raw_mail and raw_mail not in ("[]", "N/A", "") else None
|
if raw_mail in ("[]", "N/A", ""):
|
||||||
|
raw_mail = None
|
||||||
|
mail = raw_mail if raw_mail else None
|
||||||
if not mail:
|
if not mail:
|
||||||
raw_upn = str(entry.userPrincipalName) if 'userPrincipalName' in entry else ""
|
raw_upn = str(entry.userPrincipalName) if 'userPrincipalName' in entry else ""
|
||||||
if raw_upn and raw_upn not in ("[]", "N/A", ""):
|
if raw_upn and raw_upn not in ("[]", "N/A", ""):
|
||||||
|
|||||||
Reference in New Issue
Block a user