fix: deduplicate imported event ids for open data sources

This commit is contained in:
Oliver 2026-02-15 15:49:42 +01:00
parent a50d51b3b1
commit 9b3fe95683
No known key found for this signature in database
2 changed files with 4 additions and 1 deletions

View file

@ -160,10 +160,14 @@ def import_event_rows(rows: list[dict], source_name: str, notes: str) -> dict:
imported_at = now_iso()
db_rows = []
seen_ids = set()
for item in rows:
event_type = item.get("event_type")
if event_type not in VALID_TYPES:
continue
if item["id"] in seen_ids:
continue
seen_ids.add(item["id"])
db_rows.append(
(

View file

@ -45,7 +45,6 @@
"source_name": "koeln_baustellen_notfall",
"coord_crs": "EPSG:25832",
"field_map": {
"external_id": "properties.Aktenzeichen",
"lat": "geometry.coordinates.1",
"lon": "geometry.coordinates.0",
"event_type": "properties.Kategorie",