Skip to content

Commit

Permalink
Ignore rows with None DisplayName
Browse files Browse the repository at this point in the history
  • Loading branch information
edwardchalstrey1 committed Jul 10, 2024
1 parent 1f3c2fd commit 3b8704b
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions seshat/apps/core/management/commands/populate_videodata.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 3b8704b

Please sign in to comment.