mirror of
https://github.com/netbox-community/netbox.git
synced 2025-07-17 12:42:52 -06:00
Fixes #6006: Fix VLAN group/site association for bulk prefix import
This commit is contained in:
parent
91fe80f73c
commit
e4ecd2dae9
@ -9,6 +9,7 @@
|
|||||||
* [#5962](https://github.com/netbox-community/netbox/issues/5962) - Ensure consistent display of change log action labels
|
* [#5962](https://github.com/netbox-community/netbox/issues/5962) - Ensure consistent display of change log action labels
|
||||||
* [#5966](https://github.com/netbox-community/netbox/issues/5966) - Skip Markdown reference link when tabbing through form fields
|
* [#5966](https://github.com/netbox-community/netbox/issues/5966) - Skip Markdown reference link when tabbing through form fields
|
||||||
* [#5977](https://github.com/netbox-community/netbox/issues/5977) - Correct validation of `RELEASE_CHECK_URL` config parameter
|
* [#5977](https://github.com/netbox-community/netbox/issues/5977) - Correct validation of `RELEASE_CHECK_URL` config parameter
|
||||||
|
* [#6006](https://github.com/netbox-community/netbox/issues/6006) - Fix VLAN group/site association for bulk prefix import
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
|
@ -465,12 +465,14 @@ class PrefixCSVForm(CustomFieldModelCSVForm):
|
|||||||
|
|
||||||
if data:
|
if data:
|
||||||
|
|
||||||
# Limit vlan queryset by assigned site and group
|
# Limit VLAN queryset by assigned site and/or group (if specified)
|
||||||
params = {
|
params = {}
|
||||||
f"site__{self.fields['site'].to_field_name}": data.get('site'),
|
if data.get('site'):
|
||||||
f"group__{self.fields['vlan_group'].to_field_name}": data.get('vlan_group'),
|
params[f"site__{self.fields['site'].to_field_name}"] = data.get('site')
|
||||||
}
|
if data.get('vlan_group'):
|
||||||
self.fields['vlan'].queryset = self.fields['vlan'].queryset.filter(**params)
|
params[f"group__{self.fields['vlan_group'].to_field_name}"] = data.get('vlan_group')
|
||||||
|
if params:
|
||||||
|
self.fields['vlan'].queryset = self.fields['vlan'].queryset.filter(**params)
|
||||||
|
|
||||||
|
|
||||||
class PrefixBulkEditForm(BootstrapMixin, AddRemoveTagsForm, CustomFieldBulkEditForm):
|
class PrefixBulkEditForm(BootstrapMixin, AddRemoveTagsForm, CustomFieldBulkEditForm):
|
||||||
|
Loading…
Reference in New Issue
Block a user