From 80179a142c2ef43d2994a052a0370ab0174bde34 Mon Sep 17 00:00:00 2001 From: Mattia Mancini <mancini@astron.nl> Date: Wed, 13 Mar 2019 16:37:30 +0000 Subject: [PATCH] OSB-44: updating request response --- .../DBInterface/monitoringdb/views/controllers.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/LCU/Maintenance/DBInterface/monitoringdb/views/controllers.py b/LCU/Maintenance/DBInterface/monitoringdb/views/controllers.py index 84c953a813f..a2717eb5101 100644 --- a/LCU/Maintenance/DBInterface/monitoringdb/views/controllers.py +++ b/LCU/Maintenance/DBInterface/monitoringdb/views/controllers.py @@ -935,15 +935,15 @@ class ControllerStationComponentErrors(ValidableReadOnlyView): rtsm_errors = self.collect_rtsm_errors() payload = OrderedDict() - payload['current_status'] = OrderedDict() for component_type in set(rtsm_errors.keys() | station_test_errors.keys()): station_test_errors_per_type = station_test_errors.get(component_type, []) rtsm_errors_per_type = rtsm_errors.get(component_type, []) + payload[component_type] = OrderedDict() - payload[component_type] = sorted(station_test_errors_per_type + rtsm_errors_per_type, + payload[component_type]['errors'] = sorted(station_test_errors_per_type + rtsm_errors_per_type, key=lambda item: item['start_date'], reverse=True) - payload['current_status'][component_type] = WinCCAntennaStatus.objects. \ + payload[component_type]['current_status'] = WinCCAntennaStatus.objects. \ latest_status_per_station_and_component_type(self.station_name, component_type, to_date=datetime.datetime.now()) -- GitLab