|
|
@@ -1586,7 +1586,7 @@ class ConsoleServerPort(models.Model):
|
|
|
raise ValidationError("Console server ports must be assigned to devices.")
|
|
|
device_type = self.device.device_type
|
|
|
if not device_type.is_console_server:
|
|
|
- raise ValidationError("The {} {} device type not support assignment of console server ports.".format(
|
|
|
+ raise ValidationError("The {} {} device type does not support assignment of console server ports.".format(
|
|
|
device_type.manufacturer, device_type
|
|
|
))
|
|
|
|
|
|
@@ -1688,7 +1688,7 @@ class PowerOutlet(models.Model):
|
|
|
raise ValidationError("Power outlets must be assigned to devices.")
|
|
|
device_type = self.device.device_type
|
|
|
if not device_type.is_pdu:
|
|
|
- raise ValidationError("The {} {} device type not support assignment of power outlets.".format(
|
|
|
+ raise ValidationError("The {} {} device type does not support assignment of power outlets.".format(
|
|
|
device_type.manufacturer, device_type
|
|
|
))
|
|
|
|
|
|
@@ -1794,7 +1794,7 @@ class Interface(models.Model):
|
|
|
if self.device is not None:
|
|
|
device_type = self.device.device_type
|
|
|
if not device_type.is_network_device:
|
|
|
- raise ValidationError("The {} {} device type not support assignment of network interfaces.".format(
|
|
|
+ raise ValidationError("The {} {} device type does not support assignment of network interfaces.".format(
|
|
|
device_type.manufacturer, device_type
|
|
|
))
|
|
|
|
|
|
@@ -1938,6 +1938,18 @@ class InterfaceConnection(models.Model):
|
|
|
raise ValidationError({
|
|
|
'interface_b': "Cannot connect an interface to itself."
|
|
|
})
|
|
|
+ if self.interface_a.form_factor in NONCONNECTABLE_IFACE_TYPES:
|
|
|
+ raise ValidationError({
|
|
|
+ 'interface_a': '{} is not a connectable interface type.'.format(
|
|
|
+ self.interface_a.get_form_factor_display()
|
|
|
+ )
|
|
|
+ })
|
|
|
+ if self.interface_b.form_factor in NONCONNECTABLE_IFACE_TYPES:
|
|
|
+ raise ValidationError({
|
|
|
+ 'interface_b': '{} is not a connectable interface type.'.format(
|
|
|
+ self.interface_b.get_form_factor_display()
|
|
|
+ )
|
|
|
+ })
|
|
|
except ObjectDoesNotExist:
|
|
|
pass
|
|
|
|