diff --git a/netbox/templates/tenancy/contact.html b/netbox/templates/tenancy/contact.html index cf94c9451..f34a3573f 100644 --- a/netbox/templates/tenancy/contact.html +++ b/netbox/templates/tenancy/contact.html @@ -20,9 +20,15 @@ {% trans "Groups" %} - {% for group in object.groups.all %} - {{ group|linkify|placeholder }}{% if not forloop.last %}, {% endif %} - {% endfor %} + {% if object.groups.all|length > 0 %} +
    + {% for group in object.groups.all %} +
  1. {{ group|linkify|placeholder }}
  2. + {% endfor %} +
+ {% else %} + {{ ''|placeholder }} + {% endif %} diff --git a/netbox/tenancy/models/contacts.py b/netbox/tenancy/models/contacts.py index 7108d0e5b..5f39fe0db 100644 --- a/netbox/tenancy/models/contacts.py +++ b/netbox/tenancy/models/contacts.py @@ -13,6 +13,7 @@ __all__ = ( 'ContactAssignment', 'Contact', 'ContactGroup', + 'ContactGroupMembership', 'ContactRole', ) @@ -104,6 +105,8 @@ class ContactGroupMembership(models.Model): constraints = [ models.UniqueConstraint(fields=['group', 'contact'], name='unique_group_name') ] + verbose_name = _('contact group membership') + verbose_name_plural = _('contact group memberships') class ContactAssignment(CustomFieldsMixin, ExportTemplatesMixin, TagsMixin, ChangeLoggedModel):