Skip to content

Commit 7bdde47

Browse files
committed
Fixes netbox-community#7124: Fix duplicate static query param values in API Select
1 parent a2eb0d8 commit 7bdde47

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

docs/release-notes/version-3.0.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
* [#7109](https://github.com/netbox-community/netbox/issues/7109) - Ensure human readability of exceptions raised during REST API requests
2828
* [#7113](https://github.com/netbox-community/netbox/issues/7113) - Fix IPRange bulk options within Prefix view
2929
* [#7123](https://github.com/netbox-community/netbox/issues/7123) - Remove "Global" placeholder for null VRF field
30+
* [#7124](https://github.com/netbox-community/netbox/issues/7124) - Fix duplicate static query param values in API Select
3031

3132
---
3233

netbox/utilities/forms/widgets.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,7 @@ def _process_query_param(self, key: str, value: JSONPrimitive) -> None:
185185
# layer.
186186
if key in self.static_params:
187187
current = self.static_params[key]
188-
self.static_params[key] = [*current, value]
188+
self.static_params[key] = [v for v in set([*current, value])]
189189
else:
190190
self.static_params[key] = [value]
191191
else:
@@ -194,7 +194,7 @@ def _process_query_param(self, key: str, value: JSONPrimitive) -> None:
194194
# `$`).
195195
if key in self.static_params:
196196
current = self.static_params[key]
197-
self.static_params[key] = [*current, value]
197+
self.static_params[key] = [v for v in set([*current, value])]
198198
else:
199199
self.static_params[key] = [value]
200200

0 commit comments

Comments
 (0)