Fix for a situation that should be impossible

This commit is contained in:
2020-06-19 10:38:02 +01:00
parent c65330cb91
commit cb1a8e1627

View File

@@ -148,7 +148,7 @@ class Asset(models.Model, RevisionMixin):
def __str__(self):
out = str(self.asset_id) + ' - ' + self.description
if self.is_cable:
if self.is_cable and self.cable_type is not None:
out += '{} - {}m - {}'.format(self.cable_type.plug, self.length, self.cable_type.socket)
return out