mirror of
https://github.com/netbox-community/netbox.git
synced 2024-05-10 07:54:54 +00:00
remove contacts from api endpoints
This commit is contained in:
@@ -5,7 +5,6 @@ from tenancy.models import *
|
||||
|
||||
__all__ = [
|
||||
'NestedContactSerializer',
|
||||
'NestedContactAssignmentSerializer',
|
||||
'NestedContactGroupSerializer',
|
||||
'NestedContactRoleSerializer',
|
||||
'NestedTenantGroupSerializer',
|
||||
@@ -63,13 +62,3 @@ class NestedContactSerializer(WritableNestedSerializer):
|
||||
class Meta:
|
||||
model = Contact
|
||||
fields = ['id', 'url', 'display', 'name']
|
||||
|
||||
|
||||
class NestedContactAssignmentSerializer(WritableNestedSerializer):
|
||||
url = serializers.HyperlinkedIdentityField(view_name='tenancy-api:contactassignment-detail')
|
||||
contact = NestedContactSerializer()
|
||||
role = NestedContactRoleSerializer
|
||||
|
||||
class Meta:
|
||||
model = ContactAssignment
|
||||
fields = ['id', 'url', 'display', 'contact', 'role', 'priority']
|
||||
|
@@ -40,16 +40,11 @@ class TenantSerializer(PrimaryModelSerializer):
|
||||
vlan_count = serializers.IntegerField(read_only=True)
|
||||
vrf_count = serializers.IntegerField(read_only=True)
|
||||
cluster_count = serializers.IntegerField(read_only=True)
|
||||
contacts = NestedContactAssignmentSerializer(
|
||||
required=False,
|
||||
allow_null=True,
|
||||
many=True
|
||||
)
|
||||
|
||||
class Meta:
|
||||
model = Tenant
|
||||
fields = [
|
||||
'id', 'url', 'display', 'name', 'slug', 'group', 'description', 'comments', 'contacts', 'tags', 'custom_fields',
|
||||
'id', 'url', 'display', 'name', 'slug', 'group', 'description', 'comments', 'tags', 'custom_fields',
|
||||
'created', 'last_updated', 'circuit_count', 'device_count', 'ipaddress_count', 'prefix_count', 'rack_count',
|
||||
'site_count', 'virtualmachine_count', 'vlan_count', 'vrf_count', 'cluster_count',
|
||||
]
|
||||
|
Reference in New Issue
Block a user