mirror of
https://github.com/zulip/zulip.git
synced 2025-11-05 06:23:38 +00:00
ldap: Fix logging of warning for deactivated users.
Also cleans up the interface between the management command and the LDAP backends code to not guess/recompute under what circumstances what should be logged. Co-authored-by: mateuszmandera <mateusz.mandera@protonmail.com>
This commit is contained in:
@@ -22,12 +22,7 @@ def sync_ldap_user_data(user_profiles: List[UserProfile]) -> None:
|
||||
# This will save the user if relevant, and will do nothing if the user
|
||||
# does not exist.
|
||||
try:
|
||||
if sync_user_from_ldap(u):
|
||||
logger.info("Updated %s." % (u.email,))
|
||||
else:
|
||||
logger.warning("Did not find %s in LDAP." % (u.email,))
|
||||
if settings.LDAP_DEACTIVATE_NON_MATCHING_USERS:
|
||||
logger.info("Deactivated non-matching user: %s" % (u.email,))
|
||||
sync_user_from_ldap(u, logger)
|
||||
except ZulipLDAPException as e:
|
||||
logger.error("Error attempting to update user %s:" % (u.email,))
|
||||
logger.error(e)
|
||||
|
||||
Reference in New Issue
Block a user