mirror of
https://github.com/netbox-community/netbox.git
synced 2024-05-10 07:54:54 +00:00
Enable filtering FHRP groups by related IP addresses
This commit is contained in:
@@ -546,6 +546,13 @@ class FHRPGroupAssignmentForm(BootstrapMixin, forms.ModelForm):
|
||||
model = FHRPGroupAssignment
|
||||
fields = ('group', 'priority')
|
||||
|
||||
def __init__(self, *args, **kwargs):
|
||||
super().__init__(*args, **kwargs)
|
||||
|
||||
ipaddresses = self.instance.object.ip_addresses.all()
|
||||
for ipaddress in ipaddresses:
|
||||
self.fields['group'].widget.add_query_param('related_ip', ipaddress.pk)
|
||||
|
||||
|
||||
class VLANGroupForm(BootstrapMixin, CustomFieldModelForm):
|
||||
scope_type = ContentTypeChoiceField(
|
||||
|
||||
Reference in New Issue
Block a user