From ba0ce6a2f827ddd0868a81593140eacd37f8f492 Mon Sep 17 00:00:00 2001
From: Mattia Mancini <mancini@astron.nl>
Date: Mon, 15 Oct 2018 07:00:13 +0000
Subject: [PATCH] OSB-28: minor fixes

---
 .../monitoringdb/views/station_test_views.py         | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/LCU/Maintenance/DBInterface/monitoringdb/views/station_test_views.py b/LCU/Maintenance/DBInterface/monitoringdb/views/station_test_views.py
index 5424301350d..511bbbd7e5d 100644
--- a/LCU/Maintenance/DBInterface/monitoringdb/views/station_test_views.py
+++ b/LCU/Maintenance/DBInterface/monitoringdb/views/station_test_views.py
@@ -192,7 +192,7 @@ class ControllerStationOverview(APIView):
             "station_group",
             required=False,
             location='query',
-            schema=coreschema.Enum(['C', 'R', 'I', 'ALL'], description=
+            schema=coreschema.Enum(['C', 'R', 'I', 'A'], description=
                                      'Station group to select for choices are [C|R|I|ALL]',
                                    )
         ),
@@ -223,16 +223,16 @@ class ControllerStationOverview(APIView):
 
     def get(self, request, format=None):
 
-        print(request.validate())
-
         errors_only = request.query_params.get('errors_only', self.DEFAULT_ONLY_ERRORS)
-        print(request.query_params)
+
         station_group = request.query_params.get('station_group', self.DEFAULT_STATION_GROUP)
         n_station_tests = int(request.query_params.get('n_station_tests', self.DEFAULT_N_STATION_TESTS))
         n_rtsm = request.query_params.get('n_rtsm', self.DEFAULT_N_RTSM)
 
-        if station_group is not 'ALL':
-            station_entities = Station.objects.all()
+        station_entities = Station.objects.all()
+        for group in station_group:
+            if group is not 'A':
+                station_entities = station_entities.filter(type=group)
 
         # Since django preferes a ordered dict over a dict we make it happy... for now
         response_payload = OrderedDict()
-- 
GitLab