Skip to content

Commit

Permalink
events: sanitize functions (#7587)
Browse files Browse the repository at this point in the history
Signed-off-by: Jens Langhammer <jens@goauthentik.io>
  • Loading branch information
BeryJu committed Nov 15, 2023
1 parent 95c7101 commit 3d66923
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions authentik/events/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,12 @@ def sanitize_item(value: Any) -> Any:
return value.isoformat()
if isinstance(value, timedelta):
return str(value.total_seconds())
if callable(value):
return {
"type": "callable",
"name": value.__name__,
"module": value.__module__,
}
return value


Expand Down

0 comments on commit 3d66923

Please sign in to comment.