backends: Early return in sync_avatar_from_ldap.

This commit is contained in:
Alex Vandiver 2024-06-13 13:04:16 +00:00 committed by Alex Vandiver
parent 0153d6dbcd
commit b36ad31f0e
1 changed files with 29 additions and 27 deletions

View File

@ -807,7 +807,9 @@ class ZulipLDAPAuthBackendBase(ZulipAuthMixin, LDAPBackend):
return username
def sync_avatar_from_ldap(self, user: UserProfile, ldap_user: _LDAPUser) -> None:
if "avatar" in settings.AUTH_LDAP_USER_ATTR_MAP:
if "avatar" not in settings.AUTH_LDAP_USER_ATTR_MAP:
return
# We do local imports here to avoid import loops
from io import BytesIO