From d3f56ea95d79ab52e079aa36916f43c5ebedef36 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20P=C3=A9ters?= Date: Sun, 30 Sep 2018 18:39:30 +0200 Subject: [PATCH] api: limit health API results to primary services (#26833) --- hobo/rest/views.py | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/hobo/rest/views.py b/hobo/rest/views.py index a8cf9c6..050a93f 100644 --- a/hobo/rest/views.py +++ b/hobo/rest/views.py @@ -17,7 +17,7 @@ from rest_framework import generics from rest_framework import permissions -from hobo.environment.models import AVAILABLE_SERVICES +from hobo.environment.utils import get_installed_services from hobo.rest.serializers import HealthBaseSerializer @@ -26,8 +26,4 @@ class HealthList(generics.ListAPIView): permission_classes = (permissions.IsAuthenticatedOrReadOnly,) def get_queryset(self): - qs = [] - for service in AVAILABLE_SERVICES: - for instance in service.objects.all(): - qs.append(instance) - return qs + return [x for x in get_installed_services() if not x.secondary] -- 2.19.0