From ecdefde9ed57bc408eaa47485ccbd738948f9e77 Mon Sep 17 00:00:00 2001 From: Bahram Aghaei Date: Wed, 30 Apr 2025 11:14:34 +0200 Subject: [PATCH] improve actor_email assigment; the previous was not intuitive enough to understand (#720) --- auditlog/context.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/auditlog/context.py b/auditlog/context.py index a5f916c..cdd6e23 100644 --- a/auditlog/context.py +++ b/auditlog/context.py @@ -66,7 +66,7 @@ def _set_actor(user, sender, instance, signal_duid, **kwargs): and instance.actor is None ): instance.actor = user - instance.actor_email = hasattr(user, "email") and user.email or None + instance.actor_email = getattr(user, "email", None) instance.remote_addr = auditlog["remote_addr"] instance.remote_port = auditlog["remote_port"]