2
0
Эх сурвалжийг харах

Fixes #20242: Conditionally log request.id in EventRule triggered script (#20322)

Jason Novinger 5 сар өмнө
parent
commit
d1e40281f3
1 өөрчлөгдсөн 1 нэмэгдсэн , 1 устгасан
  1. 1 1
      netbox/extras/jobs.py

+ 1 - 1
netbox/extras/jobs.py

@@ -106,7 +106,7 @@ class ScriptJob(JobRunner):
 
         # 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.