diff --git a/authentik/events/utils.py b/authentik/events/utils.py index 047ae963d..23265fd9f 100644 --- a/authentik/events/utils.py +++ b/authentik/events/utils.py @@ -2,6 +2,7 @@ import re from dataclasses import asdict, is_dataclass from pathlib import Path +from types import GeneratorType from typing import Any, Optional from uuid import UUID @@ -93,6 +94,8 @@ def sanitize_item(value: Any) -> Any: value = asdict(value) if isinstance(value, dict): return sanitize_dict(value) + if isinstance(value, GeneratorType): + return sanitize_item(list(value)) if isinstance(value, list): new_values = [] for item in value: