From 93b9dae17850ae9fec236ace4a2c7d445124171d Mon Sep 17 00:00:00 2001 From: Jens Langhammer Date: Thu, 25 Apr 2024 20:32:58 +0200 Subject: [PATCH] fix logic Signed-off-by: Jens Langhammer --- authentik/sources/ldap/sync/groups.py | 5 ++++- authentik/sources/ldap/sync/users.py | 5 ++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/authentik/sources/ldap/sync/groups.py b/authentik/sources/ldap/sync/groups.py index af97703feb..b2d083d270 100644 --- a/authentik/sources/ldap/sync/groups.py +++ b/authentik/sources/ldap/sync/groups.py @@ -41,7 +41,10 @@ class GroupLDAPSynchronizer(BaseLDAPSynchronizer): continue attributes = group.get("attributes", {}) group_dn = flatten(flatten(group.get("entryDN", group.get("dn")))) - if self._source.object_uniqueness_field not in attributes: + if ( + self._source.object_uniqueness_field not in attributes + and self._source.object_uniqueness_field + ): self.message( f"Cannot find uniqueness field in attributes: '{group_dn}'", attributes=attributes.keys(), diff --git a/authentik/sources/ldap/sync/users.py b/authentik/sources/ldap/sync/users.py index ba12d74274..9c4a0f8313 100644 --- a/authentik/sources/ldap/sync/users.py +++ b/authentik/sources/ldap/sync/users.py @@ -43,7 +43,10 @@ class UserLDAPSynchronizer(BaseLDAPSynchronizer): continue attributes = user.get("attributes", {}) user_dn = flatten(user.get("entryDN", user.get("dn"))) - if self._source.object_uniqueness_field not in attributes: + if ( + self._source.object_uniqueness_field not in attributes + and self._source.object_uniqueness_field + ): self.message( f"Cannot find uniqueness field in attributes: '{user_dn}'", attributes=attributes.keys(),