From 2fe734e6f911f967a913d84de4e5874ea3401de7 Mon Sep 17 00:00:00 2001 From: jeremystretch Date: Wed, 30 Jun 2021 10:20:20 -0400 Subject: [PATCH] Omit _path from CableTermination models --- netbox/dcim/graphql/types.py | 12 ++++++------ netbox/utilities/testing/api.py | 3 --- 2 files changed, 6 insertions(+), 9 deletions(-) diff --git a/netbox/dcim/graphql/types.py b/netbox/dcim/graphql/types.py index 12342ff4b..de091ec64 100644 --- a/netbox/dcim/graphql/types.py +++ b/netbox/dcim/graphql/types.py @@ -56,7 +56,7 @@ class ConsolePortType(TaggedObjectType): class Meta: model = models.ConsolePort - fields = '__all__' + exclude = ('_path',) filterset_class = filtersets.ConsolePortFilterSet def resolve_type(self, info): @@ -78,7 +78,7 @@ class ConsoleServerPortType(TaggedObjectType): class Meta: model = models.ConsoleServerPort - fields = '__all__' + exclude = ('_path',) filterset_class = filtersets.ConsoleServerPortFilterSet def resolve_type(self, info): @@ -162,7 +162,7 @@ class InterfaceType(TaggedObjectType): class Meta: model = models.Interface - fields = '__all__' + exclude = ('_path',) filterset_class = filtersets.InterfaceFilterSet def resolve_mode(self, info): @@ -213,7 +213,7 @@ class PowerFeedType(TaggedObjectType): class Meta: model = models.PowerFeed - fields = '__all__' + exclude = ('_path',) filterset_class = filtersets.PowerFeedFilterSet @@ -221,7 +221,7 @@ class PowerOutletType(TaggedObjectType): class Meta: model = models.PowerOutlet - fields = '__all__' + exclude = ('_path',) filterset_class = filtersets.PowerOutletFilterSet def resolve_feed_leg(self, info): @@ -257,7 +257,7 @@ class PowerPortType(TaggedObjectType): class Meta: model = models.PowerPort - fields = '__all__' + exclude = ('_path',) filterset_class = filtersets.PowerPortFilterSet def resolve_type(self, info): diff --git a/netbox/utilities/testing/api.py b/netbox/utilities/testing/api.py index f0c1c92c8..3bb54b529 100644 --- a/netbox/utilities/testing/api.py +++ b/netbox/utilities/testing/api.py @@ -446,9 +446,6 @@ class APIViewTestCases: # Compile list of fields to include fields_string = '' for field_name, field in type_class._meta.fields.items(): - # TODO: Omit "hidden" fields from GraphQL types - if field_name.startswith('_'): - continue if type(field) is Dynamic: # Dynamic fields must specify a subselection fields_string += f'{field_name} {{ id }}\n'