diff --git a/netbox/vpn/models/tunnels.py b/netbox/vpn/models/tunnels.py index 6f4fa4182..6224959eb 100644 --- a/netbox/vpn/models/tunnels.py +++ b/netbox/vpn/models/tunnels.py @@ -6,7 +6,7 @@ from django.urls import reverse from django.utils.translation import gettext_lazy as _ from netbox.models import ChangeLoggedModel, OrganizationalModel, PrimaryModel -from netbox.models.features import CustomFieldsMixin, CustomLinksMixin, TagsMixin +from netbox.models.features import CustomFieldsMixin, CustomLinksMixin, TagsMixin, ContactsMixin from vpn.choices import * __all__ = ( @@ -16,7 +16,7 @@ __all__ = ( ) -class TunnelGroup(OrganizationalModel): +class TunnelGroup(ContactsMixin, OrganizationalModel): """ An administrative grouping of Tunnels. This can be used to correlate peer-to-peer tunnels which form a mesh, for example. @@ -30,7 +30,7 @@ class TunnelGroup(OrganizationalModel): return reverse('vpn:tunnelgroup', args=[self.pk]) -class Tunnel(PrimaryModel): +class Tunnel(ContactsMixin, PrimaryModel): name = models.CharField( verbose_name=_('name'), max_length=100, diff --git a/netbox/vpn/views.py b/netbox/vpn/views.py index ac8ce3667..73b2b04c0 100644 --- a/netbox/vpn/views.py +++ b/netbox/vpn/views.py @@ -62,6 +62,9 @@ class TunnelGroupBulkDeleteView(generic.BulkDeleteView): filterset = filtersets.TunnelGroupFilterSet table = tables.TunnelGroupTable +@register_model_view(Tunnel, 'contacts') +class TunnelGroupContactsView(ObjectContactsView): + queryset = TunnelGroup.objects.all() # # Tunnels @@ -121,6 +124,9 @@ class TunnelBulkDeleteView(generic.BulkDeleteView): filterset = filtersets.TunnelFilterSet table = tables.TunnelTable +@register_model_view(Tunnel, 'contacts') +class TunnelContactsView(ObjectContactsView): + queryset = Tunnel.objects.all() # # Tunnel terminations