Skip to content

Commit

Permalink
Merge pull request #18491 from antoinekh/17542-Contact_Assignment_to_…
Browse files Browse the repository at this point in the history
…vpn_tunnels

#17542 contact assignment to vpn tunnels
  • Loading branch information
bctiemann authored Feb 25, 2025
2 parents 2a56c08 + a6c07e6 commit a8b4024
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 3 deletions.
6 changes: 3 additions & 3 deletions netbox/vpn/models/tunnels.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
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 ContactsMixin, CustomFieldsMixin, CustomLinksMixin, TagsMixin
from vpn.choices import *

__all__ = (
Expand All @@ -16,7 +16,7 @@
)


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.
Expand All @@ -27,7 +27,7 @@ class Meta:
verbose_name_plural = _('tunnel groups')


class Tunnel(PrimaryModel):
class Tunnel(ContactsMixin, PrimaryModel):
name = models.CharField(
verbose_name=_('name'),
max_length=100,
Expand Down
10 changes: 10 additions & 0 deletions netbox/vpn/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,11 @@ class TunnelGroupBulkDeleteView(generic.BulkDeleteView):
table = tables.TunnelGroupTable


@register_model_view(TunnelGroup, 'contacts')
class TunnelGroupContactsView(ObjectContactsView):
queryset = TunnelGroup.objects.all()


#
# Tunnels
#
Expand Down Expand Up @@ -132,6 +137,11 @@ class TunnelBulkDeleteView(generic.BulkDeleteView):
table = tables.TunnelTable


@register_model_view(Tunnel, 'contacts')
class TunnelContactsView(ObjectContactsView):
queryset = Tunnel.objects.all()


#
# Tunnel terminations
#
Expand Down

0 comments on commit a8b4024

Please sign in to comment.