diff --git a/LCU/Maintenance/DBInterface/monitoringdb/views/controllers.py b/LCU/Maintenance/DBInterface/monitoringdb/views/controllers.py index 84c953a813f3522e21c6da7c8b016b95f0c8c709..a2717eb51011984f8fd117eb852cdb9d8378dfbf 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())