mirror of
https://github.com/netbox-community/netbox.git
synced 2024-05-10 07:54:54 +00:00
Retain ip_addresses name for related IPAddress objects
This commit is contained in:
@@ -484,7 +484,7 @@ class PowerOutletViewSet(CableTraceMixin, ModelViewSet):
|
||||
|
||||
class InterfaceViewSet(CableTraceMixin, ModelViewSet):
|
||||
queryset = Interface.objects.prefetch_related(
|
||||
'device', '_connected_interface', '_connected_circuittermination', 'cable', 'ipaddresses', 'tags'
|
||||
'device', '_connected_interface', '_connected_circuittermination', 'cable', 'ip_addresses', 'tags'
|
||||
).filter(
|
||||
device__isnull=False
|
||||
)
|
||||
|
@@ -686,7 +686,7 @@ class Interface(CableTermination, ComponentModel, BaseInterface):
|
||||
blank=True,
|
||||
verbose_name='Tagged VLANs'
|
||||
)
|
||||
ipaddresses = GenericRelation(
|
||||
ip_addresses = GenericRelation(
|
||||
to='ipam.IPAddress',
|
||||
content_type_field='assigned_object_type',
|
||||
object_id_field='assigned_object_id'
|
||||
|
@@ -1442,7 +1442,7 @@ class InterfaceView(ObjectView):
|
||||
|
||||
# Get assigned IP addresses
|
||||
ipaddress_table = InterfaceIPAddressTable(
|
||||
data=interface.ipaddresses.restrict(request.user, 'view').prefetch_related('vrf', 'tenant'),
|
||||
data=interface.ip_addresses.restrict(request.user, 'view').prefetch_related('vrf', 'tenant'),
|
||||
orderable=False
|
||||
)
|
||||
|
||||
|
Reference in New Issue
Block a user