api: limit health API results to primary services (#26833)

This commit is contained in:
Frédéric Péters 2018-09-30 18:39:30 +02:00
parent e84ba975b4
commit 5253066f5d
1 changed files with 2 additions and 6 deletions

View File

@ -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]