mirror of
https://github.com/netbox-community/netbox.git
synced 2025-07-25 01:48:38 -06:00
Fixes #1239: Fix server error when creating VLANGroup via API
This commit is contained in:
parent
6aae8aee5b
commit
f03a378ce0
@ -137,7 +137,7 @@ class WritableVLANGroupSerializer(serializers.ModelSerializer):
|
|||||||
# Validate uniqueness of name and slug if a site has been assigned.
|
# Validate uniqueness of name and slug if a site has been assigned.
|
||||||
if data.get('site', None):
|
if data.get('site', None):
|
||||||
for field in ['name', 'slug']:
|
for field in ['name', 'slug']:
|
||||||
validator = UniqueTogetherValidator(queryset=VLAN.objects.all(), fields=('site', field))
|
validator = UniqueTogetherValidator(queryset=VLANGroup.objects.all(), fields=('site', field))
|
||||||
validator.set_context(self)
|
validator.set_context(self)
|
||||||
validator(data)
|
validator(data)
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user