From e6642b5f5b1fc868cef95cb508eb666996872a8e Mon Sep 17 00:00:00 2001 From: Jeremy Stretch Date: Wed, 27 Dec 2023 09:44:15 -0500 Subject: [PATCH] Fixes #11816: Detach group/site validation error from group field --- netbox/ipam/models/vlans.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/netbox/ipam/models/vlans.py b/netbox/ipam/models/vlans.py index aa5b36a57..d2365aa37 100644 --- a/netbox/ipam/models/vlans.py +++ b/netbox/ipam/models/vlans.py @@ -224,11 +224,11 @@ class VLAN(PrimaryModel): # Validate VLAN group (if assigned) if self.group and self.site and self.group.scope != self.site: - raise ValidationError({ - 'group': _( + raise ValidationError( + _( "VLAN is assigned to group {group} (scope: {scope}); cannot also assign to site {site}." ).format(group=self.group, scope=self.group.scope, site=self.site) - }) + ) # Validate group min/max VIDs if self.group and not self.group.min_vid <= self.vid <= self.group.max_vid: