mirror of
https://github.com/netbox-community/netbox.git
synced 2025-07-23 04:22:01 -06:00
fixes #4647 - caching invalidation related to assinging new IP addresses to interfaces
This commit is contained in:
parent
2c2d6c6d47
commit
14744da8f6
@ -5,6 +5,8 @@ v2.8.5 (FUTURE)
|
|||||||
### Bug Fixes
|
### Bug Fixes
|
||||||
|
|
||||||
* [#3304](https://github.com/netbox-community/netbox/issues/3304) - Fix caching invalidation issue related to device/virtual machine primary IP addresses
|
* [#3304](https://github.com/netbox-community/netbox/issues/3304) - Fix caching invalidation issue related to device/virtual machine primary IP addresses
|
||||||
|
* [#4647](https://github.com/netbox-community/netbox/issues/4647) - Fix caching invalidation issue related to assinging new IP addresses to interfaces
|
||||||
|
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
|
@ -618,7 +618,12 @@ class IPAddressForm(BootstrapMixin, TenancyForm, ReturnURLForm, CustomFieldModel
|
|||||||
if self.instance and self.instance.interface:
|
if self.instance and self.instance.interface:
|
||||||
self.fields['interface'].queryset = Interface.objects.filter(
|
self.fields['interface'].queryset = Interface.objects.filter(
|
||||||
device=self.instance.interface.device, virtual_machine=self.instance.interface.virtual_machine
|
device=self.instance.interface.device, virtual_machine=self.instance.interface.virtual_machine
|
||||||
)
|
).prefetch_related(
|
||||||
|
'device__primary_ip4',
|
||||||
|
'device__primary_ip6',
|
||||||
|
'virtual_machine__primary_ip4',
|
||||||
|
'virtual_machine__primary_ip6',
|
||||||
|
) # We prefetch the primary address fields to ensure cache invalidation does not balk on the save()
|
||||||
else:
|
else:
|
||||||
self.fields['interface'].choices = []
|
self.fields['interface'].choices = []
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user