Skip to content

Commit d1e4028

Browse files
authored
Fixes #20242: Conditionally log request.id in EventRule triggered script (#20322)
1 parent be4db9a commit d1e4028

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

netbox/extras/jobs.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ def run(self, data, request=None, commit=True, **kwargs):
106106

107107
# Add the current request as a property of the script
108108
script.request = request
109-
self.logger.debug(f"Request ID: {request.id}")
109+
self.logger.debug(f"Request ID: {request.id if request else None}")
110110

111111
# Execute the script. If commit is True, wrap it with the event_tracking context manager to ensure we process
112112
# change logging, event rules, etc.

0 commit comments

Comments
 (0)