From 3b8704be62331a088c7e5a23f32cc86f3b362f12 Mon Sep 17 00:00:00 2001 From: Ed Chalstrey Date: Wed, 10 Jul 2024 14:30:03 +0100 Subject: [PATCH] Ignore rows with None DisplayName --- seshat/apps/core/management/commands/populate_videodata.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/seshat/apps/core/management/commands/populate_videodata.py b/seshat/apps/core/management/commands/populate_videodata.py index b1002a352..c8ba15da8 100644 --- a/seshat/apps/core/management/commands/populate_videodata.py +++ b/seshat/apps/core/management/commands/populate_videodata.py @@ -39,6 +39,8 @@ def handle(self, *args, **options): self.stdout.write(self.style.SUCCESS('Adding data to the database...')) for feature in cliopatria_data['features']: properties = feature['properties'] + if properties['DisplayName'] is None: # Ignore rows where the DisplayName is None + continue self.stdout.write(self.style.SUCCESS(f"Creating VideoShapefile instance for {properties['DisplayName']} ({properties['FromYear']} - {properties['ToYear']})")) # Save geom and convert Polygon to MultiPolygon if necessary