From a00708c7a93a511a55aa551d32a21b2145cf3158 Mon Sep 17 00:00:00 2001 From: Jason Novinger Date: Thu, 11 Sep 2025 08:17:46 -0600 Subject: [PATCH] Fixes #20242: Conditionally log request.id in EventRule triggered script --- netbox/extras/jobs.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/netbox/extras/jobs.py b/netbox/extras/jobs.py index 8a039c7c8a5..c270833b1e5 100644 --- a/netbox/extras/jobs.py +++ b/netbox/extras/jobs.py @@ -106,7 +106,7 @@ def run(self, data, request=None, commit=True, **kwargs): # Add the current request as a property of the script script.request = request - self.logger.debug(f"Request ID: {request.id}") + self.logger.debug(f"Request ID: {request.id if request else None}") # Execute the script. If commit is True, wrap it with the event_tracking context manager to ensure we process # change logging, event rules, etc.