Skip to content

Commit aac3a51

Browse files
arthansonjeremystretch
authored andcommitted
20743 add request to Script EventRule run
1 parent 3e0ad21 commit aac3a51

File tree

1 file changed

+11
-4
lines changed

1 file changed

+11
-4
lines changed

netbox/extras/events.py

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -134,11 +134,18 @@ def process_event_rules(event_rules, object_type, event_type, data, username=Non
134134

135135
# Enqueue a Job to record the script's execution
136136
from extras.jobs import ScriptJob
137+
params = {
138+
"instance": event_rule.action_object,
139+
"name": script.name,
140+
"user": user,
141+
"data": event_data
142+
}
143+
if snapshots:
144+
params["snapshots"] = snapshots
145+
if request:
146+
params["request"] = copy_safe_request(request)
137147
ScriptJob.enqueue(
138-
instance=event_rule.action_object,
139-
name=script.name,
140-
user=user,
141-
data=event_data
148+
**params
142149
)
143150

144151
# Notification groups

0 commit comments

Comments
 (0)