From bfc1cab6dfe620d6d0615158b4730fb5af7ede19 Mon Sep 17 00:00:00 2001 From: jeremystretch Date: Mon, 13 Dec 2021 08:22:48 -0500 Subject: [PATCH] Fixes #8051: Contact group parent assignment should not be required under REST API --- docs/release-notes/version-3.1.md | 1 + netbox/tenancy/api/serializers.py | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/docs/release-notes/version-3.1.md b/docs/release-notes/version-3.1.md index db320ba37..a89ec5fd7 100644 --- a/docs/release-notes/version-3.1.md +++ b/docs/release-notes/version-3.1.md @@ -24,6 +24,7 @@ * [#8035](https://github.com/netbox-community/netbox/issues/8035) - Redirect back to parent prefix after creating IP address(es) where applicable * [#8038](https://github.com/netbox-community/netbox/issues/8038) - Placeholder filter should display zero integer values * [#8042](https://github.com/netbox-community/netbox/issues/8042) - Fix filtering cables list by site slug or rack name +* [#8051](https://github.com/netbox-community/netbox/issues/8051) - Contact group parent assignment should not be required under REST API --- diff --git a/netbox/tenancy/api/serializers.py b/netbox/tenancy/api/serializers.py index f60c8f258..a0482aa1d 100644 --- a/netbox/tenancy/api/serializers.py +++ b/netbox/tenancy/api/serializers.py @@ -56,7 +56,7 @@ class TenantSerializer(PrimaryModelSerializer): class ContactGroupSerializer(NestedGroupModelSerializer): url = serializers.HyperlinkedIdentityField(view_name='tenancy-api:contactgroup-detail') - parent = NestedContactGroupSerializer(required=False, allow_null=True) + parent = NestedContactGroupSerializer(required=False, allow_null=True, default=None) contact_count = serializers.IntegerField(read_only=True) class Meta: