1
0
mirror of https://github.com/netbox-community/netbox.git synced 2024-05-10 07:54:54 +00:00

#878: Show assigned IP addresses in device interfaces list

This commit is contained in:
Jeremy Stretch
2017-04-12 22:02:23 -04:00
parent b42dab3eef
commit d5c3f9e780
6 changed files with 84 additions and 74 deletions

View File

@@ -1713,7 +1713,7 @@ class IPAddressForm(BootstrapMixin, CustomFieldForm):
self.fields['interface'].required = True
# If this device has only one interface, select it by default.
if len(interfaces) == 1:
if 'interface' not in self.initial and len(interfaces) == 1:
self.fields['interface'].initial = interfaces[0]
# If this device does not have any IP addresses assigned, default to setting the first IP as its primary.