diff --git a/machines/models.py b/machines/models.py index 17a5f122..bd9f7eb3 100644 --- a/machines/models.py +++ b/machines/models.py @@ -190,6 +190,11 @@ class Machine(RevMixin, FieldPermissionModelMixin, models.Model): "que les vĂ´tres") return True, None + @cached_property + def short_name(self): + return str(self.interface_set.first().domain.name) + + def __init__(self, *args, **kwargs): super(Machine, self).__init__(*args, **kwargs) self.field_permissions = { diff --git a/topologie/models.py b/topologie/models.py index e1c945c7..7c6865e2 100644 --- a/topologie/models.py +++ b/topologie/models.py @@ -127,10 +127,6 @@ class AccessPoint(AclMixin, Machine): switchbay__switch=self.switch() ) - @cached_property - def short_name(self): - return str(self.interface_set.first().domain.name) - @classmethod def all_ap_in(cls, building_instance): """Get a building as argument, returns all ap of a building"""