runscript cli comand does not pass cleaned data to script #18480
Labels
status: needs triage
This issue is awaiting triage by a maintainer
type: bug
A confirmed report of unexpected behavior in the application
Deployment Type
Self-hosted
NetBox Version
v4.2.2
Python Version
3.12
Steps to Reproduce
Expected Behavior
Script is passed Site instance with id 1 in
data['site']
and script completes successfully.Observed Behavior
Script produces an error:
Looking at the Job logs, we can see that script was passed an int in data['site'] instead of Site instance:
The problem is that runscript passes
data
to ScriptJob as given on CLI, instead of passingform.cleaned_data
. Since the form is already being processed to validate data in the same file above, it would make sense to pass cleaned data.I can provide a pull request with a fix if accepted.
The same issue is present when running scripts via REST API (
/api/extras/scripts/test_call.TestScript/
). I can open a separate bug for that, if this one will be accepted.The text was updated successfully, but these errors were encountered: