From 31bb9954905ef4ed529a4abdcf80345db7760d4f Mon Sep 17 00:00:00 2001 From: Marc 'risson' Schmitt Date: Fri, 27 Jun 2025 15:46:34 +0200 Subject: [PATCH] fix some more tests Signed-off-by: Marc 'risson' Schmitt --- authentik/events/utils.py | 3 --- authentik/sources/ldap/sync/groups.py | 2 +- authentik/sources/ldap/sync/users.py | 2 +- 3 files changed, 2 insertions(+), 5 deletions(-) diff --git a/authentik/events/utils.py b/authentik/events/utils.py index f146636a8d..d55d0ec927 100644 --- a/authentik/events/utils.py +++ b/authentik/events/utils.py @@ -1,6 +1,5 @@ """event utilities""" -from collections.abc import KeysView import re from copy import copy from dataclasses import asdict, is_dataclass @@ -109,8 +108,6 @@ def sanitize_item(value: Any) -> Any: # noqa: PLR0911, PLR0912 value = asdict(value) if isinstance(value, dict): return sanitize_dict(value) - if isinstance(value, KeysView): - return list(value) if isinstance(value, GeneratorType): return sanitize_item(list(value)) if isinstance(value, list | tuple | set): diff --git a/authentik/sources/ldap/sync/groups.py b/authentik/sources/ldap/sync/groups.py index e14f49732e..dce6ffebec 100644 --- a/authentik/sources/ldap/sync/groups.py +++ b/authentik/sources/ldap/sync/groups.py @@ -66,7 +66,7 @@ class GroupLDAPSynchronizer(BaseLDAPSynchronizer): if not (uniq := self.get_identifier(attributes)): self._task.info( f"Uniqueness field not found/not set in attributes: '{group_dn}'", - attributes=attributes.keys(), + attributes=list(attributes.keys()), dn=group_dn, ) continue diff --git a/authentik/sources/ldap/sync/users.py b/authentik/sources/ldap/sync/users.py index f29ccc5f01..a23e456f1a 100644 --- a/authentik/sources/ldap/sync/users.py +++ b/authentik/sources/ldap/sync/users.py @@ -67,7 +67,7 @@ class UserLDAPSynchronizer(BaseLDAPSynchronizer): if not (uniq := self.get_identifier(attributes)): self._task.info( f"Uniqueness field not found/not set in attributes: '{user_dn}'", - attributes=attributes.keys(), + attributes=list(attributes.keys()), dn=user_dn, ) continue