From 89d490cc69aa8ca0943de60780879943d8a62570 Mon Sep 17 00:00:00 2001 From: Jeremy Stretch Date: Thu, 10 Oct 2024 16:22:54 -0400 Subject: [PATCH] Ignore F821 errors for GraphQL mixins --- netbox/core/graphql/mixins.py | 2 +- netbox/dcim/graphql/mixins.py | 40 ++++++++++++++++---------------- netbox/ipam/graphql/mixins.py | 4 ++-- netbox/tenancy/graphql/mixins.py | 2 +- 4 files changed, 24 insertions(+), 24 deletions(-) diff --git a/netbox/core/graphql/mixins.py b/netbox/core/graphql/mixins.py index 43f8761d1..5195b52a0 100644 --- a/netbox/core/graphql/mixins.py +++ b/netbox/core/graphql/mixins.py @@ -15,7 +15,7 @@ __all__ = ( class ChangelogMixin: @strawberry_django.field - def changelog(self, info) -> List[Annotated["ObjectChangeType", strawberry.lazy('.types')]]: + def changelog(self, info) -> List[Annotated["ObjectChangeType", strawberry.lazy('.types')]]: # noqa: F821 content_type = ContentType.objects.get_for_model(self) object_changes = ObjectChange.objects.filter( changed_object_type=content_type, diff --git a/netbox/dcim/graphql/mixins.py b/netbox/dcim/graphql/mixins.py index a489ef1f6..2e5ab7ea7 100644 --- a/netbox/dcim/graphql/mixins.py +++ b/netbox/dcim/graphql/mixins.py @@ -10,18 +10,18 @@ __all__ = ( @strawberry.type class CabledObjectMixin: - cable: Annotated["CableType", strawberry.lazy('dcim.graphql.types')] | None + cable: Annotated["CableType", strawberry.lazy('dcim.graphql.types')] | None # noqa: F821 link_peers: List[Annotated[Union[ - Annotated["CircuitTerminationType", strawberry.lazy('circuits.graphql.types')], - Annotated["ConsolePortType", strawberry.lazy('dcim.graphql.types')], - Annotated["ConsoleServerPortType", strawberry.lazy('dcim.graphql.types')], - Annotated["FrontPortType", strawberry.lazy('dcim.graphql.types')], - Annotated["InterfaceType", strawberry.lazy('dcim.graphql.types')], - Annotated["PowerFeedType", strawberry.lazy('dcim.graphql.types')], - Annotated["PowerOutletType", strawberry.lazy('dcim.graphql.types')], - Annotated["PowerPortType", strawberry.lazy('dcim.graphql.types')], - Annotated["RearPortType", strawberry.lazy('dcim.graphql.types')], + Annotated["CircuitTerminationType", strawberry.lazy('circuits.graphql.types')], # noqa: F821 + Annotated["ConsolePortType", strawberry.lazy('dcim.graphql.types')], # noqa: F821 + Annotated["ConsoleServerPortType", strawberry.lazy('dcim.graphql.types')], # noqa: F821 + Annotated["FrontPortType", strawberry.lazy('dcim.graphql.types')], # noqa: F821 + Annotated["InterfaceType", strawberry.lazy('dcim.graphql.types')], # noqa: F821 + Annotated["PowerFeedType", strawberry.lazy('dcim.graphql.types')], # noqa: F821 + Annotated["PowerOutletType", strawberry.lazy('dcim.graphql.types')], # noqa: F821 + Annotated["PowerPortType", strawberry.lazy('dcim.graphql.types')], # noqa: F821 + Annotated["RearPortType", strawberry.lazy('dcim.graphql.types')], # noqa: F821 ], strawberry.union("LinkPeerType")]] @@ -29,14 +29,14 @@ class CabledObjectMixin: class PathEndpointMixin: connected_endpoints: List[Annotated[Union[ - Annotated["CircuitTerminationType", strawberry.lazy('circuits.graphql.types')], - Annotated["ConsolePortType", strawberry.lazy('dcim.graphql.types')], - Annotated["ConsoleServerPortType", strawberry.lazy('dcim.graphql.types')], - Annotated["FrontPortType", strawberry.lazy('dcim.graphql.types')], - Annotated["InterfaceType", strawberry.lazy('dcim.graphql.types')], - Annotated["PowerFeedType", strawberry.lazy('dcim.graphql.types')], - Annotated["PowerOutletType", strawberry.lazy('dcim.graphql.types')], - Annotated["PowerPortType", strawberry.lazy('dcim.graphql.types')], - Annotated["ProviderNetworkType", strawberry.lazy('circuits.graphql.types')], - Annotated["RearPortType", strawberry.lazy('dcim.graphql.types')], + Annotated["CircuitTerminationType", strawberry.lazy('circuits.graphql.types')], # noqa: F821 + Annotated["ConsolePortType", strawberry.lazy('dcim.graphql.types')], # noqa: F821 + Annotated["ConsoleServerPortType", strawberry.lazy('dcim.graphql.types')], # noqa: F821 + Annotated["FrontPortType", strawberry.lazy('dcim.graphql.types')], # noqa: F821 + Annotated["InterfaceType", strawberry.lazy('dcim.graphql.types')], # noqa: F821 + Annotated["PowerFeedType", strawberry.lazy('dcim.graphql.types')], # noqa: F821 + Annotated["PowerOutletType", strawberry.lazy('dcim.graphql.types')], # noqa: F821 + Annotated["PowerPortType", strawberry.lazy('dcim.graphql.types')], # noqa: F821 + Annotated["ProviderNetworkType", strawberry.lazy('circuits.graphql.types')], # noqa: F821 + Annotated["RearPortType", strawberry.lazy('dcim.graphql.types')], # noqa: F821 ], strawberry.union("ConnectedEndpointType")]] diff --git a/netbox/ipam/graphql/mixins.py b/netbox/ipam/graphql/mixins.py index 757e62c74..692741871 100644 --- a/netbox/ipam/graphql/mixins.py +++ b/netbox/ipam/graphql/mixins.py @@ -10,9 +10,9 @@ __all__ = ( @strawberry.type class IPAddressesMixin: - ip_addresses: List[Annotated["IPAddressType", strawberry.lazy('ipam.graphql.types')]] + ip_addresses: List[Annotated["IPAddressType", strawberry.lazy('ipam.graphql.types')]] # noqa: F821 @strawberry.type class VLANGroupsMixin: - vlan_groups: List[Annotated["VLANGroupType", strawberry.lazy('ipam.graphql.types')]] + vlan_groups: List[Annotated["VLANGroupType", strawberry.lazy('ipam.graphql.types')]] # noqa: F821 diff --git a/netbox/tenancy/graphql/mixins.py b/netbox/tenancy/graphql/mixins.py index 2d97ba718..9cdba100e 100644 --- a/netbox/tenancy/graphql/mixins.py +++ b/netbox/tenancy/graphql/mixins.py @@ -10,4 +10,4 @@ __all__ = ( @strawberry.type class ContactAssignmentsMixin: - assignments: List[Annotated["ContactAssignmentType", strawberry.lazy('tenancy.graphql.types')]] + assignments: List[Annotated["ContactAssignmentType", strawberry.lazy('tenancy.graphql.types')]] # noqa: F821