Run links keep only the last value of repeated query parameters
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 72/100
Research direction
Start with the Run view’s initial value preparation, where the issue says request.GET.dict() drops repeated parameters, and compare it with NetBox’s built-in Script view using normalize_querydict(). Check how the Run form handles MultiObjectVar and MultiChoiceVar values. Done means both values from a repeated query parameter are selected; confirm this for both field types.
Written by the indexing model from the issue text.
Description
Plugin Version
v0.0.1
NetBox Version
v4.7.4
Python Version
3.12
Steps to Reproduce
- Upload and activate the following Script:
from dcim.models import Interface from netbox_scripts import MultiObjectVar, Script class PickInterfaces(Script): interfaces = MultiObjectVar(model=Interface) def run(self, data, commit): for interface in data['interfaces']: self.log_info(str(interface), obj=interface) - Use two existing interfaces, or create two on a device, and note their IDs.
- As a user who can run the Script and view both interfaces, open its Run URL with the
interfacesparameter repeated. Replace the sample IDs with the actual interface IDs:/plugins/netbox-scripts/scripts/<id>/run/?interfaces=1&interfaces=2
Expected Behavior
Both interfaces are selected in the form, matching NetBox's built-in Script form.
Observed Behavior
Only interface 2 is selected.
The Run view prepares initial values with request.GET.dict(), which discards earlier values for the same parameter. This also affects MultiChoiceVar fields. NetBox's built-in Script view preserves repeated values with normalize_querydict().
- Dominant language
- Python
- Stars
- 8
- Forks
- 0
- Avg merge
- 11h 35m
- Merged PRs (30d)
- 20
Getting set up
- No Dockerfile or Docker Compose file
- Has a pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from netbox-community/netbox-scripts
-
app: scripts status: backlog type: documentation
Difficulty 2/5 1-3 hours Newbie friendliness 85/100
netbox-community/netbox-scripts#80 ·
Maintainers usually reply within 1 day
-
app: scripts severity: medium status: backlog type: bug
Difficulty 1/5 Under an hour Newbie friendliness 88/100
netbox-community/netbox-scripts#79 ·
Maintainers usually reply within 1 day
-
app: scripts severity: medium status: backlog type: bug
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
netbox-community/netbox-scripts#77 ·
Maintainers usually reply within 1 day
-
app: scripts severity: low status: backlog type: bug
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
netbox-community/netbox-scripts#76 ·
Maintainers usually reply within 1 day
-
app: scripts severity: low status: backlog type: bug
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
netbox-community/netbox-scripts#74 ·
Maintainers usually reply within 1 day
All issues in netbox-community/netbox-scripts
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
vllm-project/vllm#64845 ·
Maintainers usually reply within 1 day
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
dekobon/big-code-analysis#1729 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
pydantic/pydantic-ai#12091 ·
Maintainers usually reply within 1 day
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100