From 74c03e32957ba4a185c75c94d9c243803bebf9cb Mon Sep 17 00:00:00 2001 From: Jeremy Stretch Date: Thu, 4 Apr 2019 15:07:41 -0400 Subject: [PATCH] Fixes #3036: DCIM interfaces API endpoint should not include VM interfaces --- CHANGELOG.md | 1 + netbox/dcim/api/views.py | 4 +++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 5579f649d..d959522aa 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,7 @@ v2.5.10 (FUTURE) ## Bug Fixes +* [#3036](https://github.com/digitalocean/netbox/issues/3036) - DCIM interfaces API endpoint should not include VM interfaces * [#3039](https://github.com/digitalocean/netbox/issues/3039) - Fix exception when retrieving change object for a component template via API * [#3041](https://github.com/digitalocean/netbox/issues/3041) - Fix form widget for bulk cable label update diff --git a/netbox/dcim/api/views.py b/netbox/dcim/api/views.py index db8cb87a9..8964e7fcb 100644 --- a/netbox/dcim/api/views.py +++ b/netbox/dcim/api/views.py @@ -419,7 +419,9 @@ class PowerOutletViewSet(CableTraceMixin, ModelViewSet): class InterfaceViewSet(CableTraceMixin, ModelViewSet): - queryset = Interface.objects.select_related( + queryset = Interface.objects.filter( + device__isnull=False + ).select_related( 'device', '_connected_interface', '_connected_circuittermination', 'cable' ).prefetch_related( 'ip_addresses', 'tags'