|
|
@@ -592,11 +592,9 @@ class PowerConnectionViewSet(ListModelMixin, GenericViewSet):
|
|
|
|
|
|
class InterfaceConnectionViewSet(ListModelMixin, GenericViewSet):
|
|
|
queryset = Interface.objects.prefetch_related('device', '_path').filter(
|
|
|
- # Avoid duplicate connections by only selecting the lower PK in a connected pair
|
|
|
_path__destination_type__app_label='dcim',
|
|
|
_path__destination_type__model='interface',
|
|
|
- _path__destination_id__isnull=False,
|
|
|
- pk__lt=F('_path__destination_id')
|
|
|
+ _path__destination_id__isnull=False
|
|
|
)
|
|
|
serializer_class = serializers.InterfaceConnectionSerializer
|
|
|
filterset_class = filtersets.InterfaceConnectionFilterSet
|