diff --git a/machines/models.py b/machines/models.py index 4caca48a..412e3750 100644 --- a/machines/models.py +++ b/machines/models.py @@ -213,6 +213,11 @@ class Machine(RevMixin, FieldPermissionModelMixin, models.Model): interface_parent__machine=self ).values_list('name', flat=True).distinct() + @cached_property + def get_name(self): + """Return a name : user provided name or first interface name""" + return self.name or self.short_name + @cached_property def all_complete_names(self): """Renvoie tous les tls complets de la machine""" diff --git a/machines/templates/machines/aff_machines.html b/machines/templates/machines/aff_machines.html index bd65fc76..60e1a57a 100644 --- a/machines/templates/machines/aff_machines.html +++ b/machines/templates/machines/aff_machines.html @@ -52,7 +52,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,