From 733dd81f0e6feea1bb63bb7d0e22dd90bd57dfa9 Mon Sep 17 00:00:00 2001 From: Jeremy Stretch Date: Thu, 17 Jul 2025 09:45:56 -0400 Subject: [PATCH] Closes #19738: Deprecate the direct assignment of a VLAN to a site (#19904) --- docs/models/ipam/vlan.md | 3 +++ netbox/ipam/forms/model_forms.py | 11 ++++++++++- 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/docs/models/ipam/vlan.md b/docs/models/ipam/vlan.md index 3c90d8cc9..794510842 100644 --- a/docs/models/ipam/vlan.md +++ b/docs/models/ipam/vlan.md @@ -25,6 +25,9 @@ The user-defined functional [role](./role.md) assigned to the VLAN. ### VLAN Group or Site +!!! warning "Site assignment is deprecated" + The assignment of individual VLANs directly to a site has been deprecated. This ability will be removed in a future NetBox release. Users are strongly encouraged to utilize VLAN groups, which have the added benefit of supporting the assignment of a VLAN to multiple sites. + The [VLAN group](./vlangroup.md) or [site](../dcim/site.md) to which the VLAN is assigned. ### Q-in-Q Role diff --git a/netbox/ipam/forms/model_forms.py b/netbox/ipam/forms/model_forms.py index 83bb42a4f..e2d9717e9 100644 --- a/netbox/ipam/forms/model_forms.py +++ b/netbox/ipam/forms/model_forms.py @@ -20,6 +20,7 @@ from utilities.forms.fields import ( from utilities.forms.rendering import FieldSet, InlineFields, ObjectAttribute, TabbedGroups from utilities.forms.utils import get_field_value from utilities.forms.widgets import DatePicker, HTMXSelect +from django.utils.safestring import mark_safe from utilities.templatetags.builtins.filters import bettertitle from virtualization.models import VMInterface @@ -680,7 +681,15 @@ class VLANForm(TenancyForm, NetBoxModelForm): queryset=Site.objects.all(), required=False, null_option='None', - selector=True + selector=True, + help_text=mark_safe( + ' {text}'.format( + text=_( + 'The direct assignment of VLANs to a site is deprecated and will be removed in a future release. ' + 'Users are encouraged to utilize VLAN groups for this purpose.' + ) + ) + ) ) role = DynamicModelChoiceField( label=_('Role'),