Просмотр исходного кода

Fixes #8051: Contact group parent assignment should not be required under REST API

jeremystretch 4 лет назад
Родитель
Сommit
bfc1cab6df
2 измененных файлов с 2 добавлено и 1 удалено
  1. 1 0
      docs/release-notes/version-3.1.md
  2. 1 1
      netbox/tenancy/api/serializers.py

+ 1 - 0
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
 
 ---
 

+ 1 - 1
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: