From 0898112c7a06248ec2ed6badd5990ee82dc8dcdd Mon Sep 17 00:00:00 2001 From: Florian Knappers <73856313+JJFlorian@users.noreply.github.com> Date: Wed, 14 Aug 2024 16:27:07 +0200 Subject: [PATCH] fixed bug:top diameter -> top position --- api/bro_import/object_import.py | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/api/bro_import/object_import.py b/api/bro_import/object_import.py index 64a3936..e509ea6 100644 --- a/api/bro_import/object_import.py +++ b/api/bro_import/object_import.py @@ -341,15 +341,15 @@ def _save_monitoringtubes_data( "numberOfGeoOhmCables", None ), "geo_ohm_cables": geo_ohm_data or [], - "tube_top_diameter": self._lookup_most_recent_top_position( - monitoringtube, event_data + "tube_top_diameter": monitoringtube.get("tubeTopDiameter", {}).get( + "@xsi:nil", None ), "variable_diameter": monitoringtube.get("variableDiameter", None), "tube_status": monitoringtube.get("tubeStatus", {}).get( "#text", None ), - "tube_top_position": monitoringtube.get("tubeTopPosition", {}).get( - "#text", None + "tube_top_position": self._lookup_most_recent_top_position( + monitoringtube, event_data ), "tube_top_positioning_method": monitoringtube.get( "tubeTopPositioningMethod", {} @@ -403,8 +403,6 @@ def _lookup_most_recent_top_position( intermediate_events = [intermediate_events] for intermediate_event in intermediate_events: - print(type(intermediate_event)) - print(intermediate_event) if ( intermediate_event.get("eventName", {}).get("#text") == "nieuweInmetingPosities"