From b31eea196621bb31ad4b71fdabd82959b7c91d90 Mon Sep 17 00:00:00 2001 From: Gabriel Detraz Date: Thu, 2 Feb 2017 14:52:26 +0100 Subject: [PATCH] Application du filter --- machines/views.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/machines/views.py b/machines/views.py index 81fe11c6..62550acf 100644 --- a/machines/views.py +++ b/machines/views.py @@ -726,11 +726,11 @@ class JSONResponse(HttpResponse): @login_required @permission_required('serveur') def mac_ip_list(request): - interfaces = Interface.objects.select_related('ipv4').select_related('domain').all() - filter( + interf = Interface.objects.select_related('ipv4').select_related('domain__extension').all() + interfaces = list(filter( lambda interface: interface.ipv4 and interface.is_active(), - interfaces - ) + interf + )) seria = InterfaceSerializer(interfaces, many=True) return seria.data