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

Fixes #1265: Fix console/power/interface connection validation when selecting a device via live search

This commit is contained in:
Jeremy Stretch
2017-06-14 13:00:36 -04:00
parent 78d74261e9
commit fcacac7c6f
3 changed files with 9 additions and 4 deletions

View File

@@ -1594,9 +1594,10 @@ class InterfaceConnectionForm(BootstrapMixin, ChainedFieldsMixin, forms.ModelFor
]
# Mark connected interfaces as disabled
self.fields['interface_b'].choices = [
(iface.id, {'label': iface.name, 'disabled': iface.is_connected}) for iface in self.fields['interface_b'].queryset
]
if self.data.get('device_b'):
self.fields['interface_b'].choices = [
(iface.id, {'label': iface.name, 'disabled': iface.is_connected}) for iface in self.fields['interface_b'].queryset
]
class InterfaceConnectionCSVForm(forms.ModelForm):