Projet

Général

Profil

0001-api-limit-health-API-results-to-primary-services-268.patch

Frédéric Péters, 30 septembre 2018 18:40

Télécharger (1,14 ko)

Voir les différences:

Subject: [PATCH] api: limit health API results to primary services (#26833)

 hobo/rest/views.py | 8 ++------
 1 file changed, 2 insertions(+), 6 deletions(-)
hobo/rest/views.py
17 17
from rest_framework import generics
18 18
from rest_framework import permissions
19 19

  
20
from hobo.environment.models import AVAILABLE_SERVICES
20
from hobo.environment.utils import get_installed_services
21 21
from hobo.rest.serializers import HealthBaseSerializer
22 22

  
23 23

  
......
26 26
    permission_classes = (permissions.IsAuthenticatedOrReadOnly,)
27 27

  
28 28
    def get_queryset(self):
29
        qs = []
30
        for service in AVAILABLE_SERVICES:
31
            for instance in service.objects.all():
32
                qs.append(instance)
33
        return qs
29
        return [x for x in get_installed_services() if not x.secondary]
34
-