From 6e21b4845314037b31191fb61af4ceefd510827e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Reuiller?= Date: Mon, 21 Oct 2024 15:14:16 +0200 Subject: [PATCH] continue if geo_range not define --- lemarche/siaes/management/commands/create_siae_activities.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lemarche/siaes/management/commands/create_siae_activities.py b/lemarche/siaes/management/commands/create_siae_activities.py index 0e4ea745e..4a7790916 100644 --- a/lemarche/siaes/management/commands/create_siae_activities.py +++ b/lemarche/siaes/management/commands/create_siae_activities.py @@ -111,6 +111,9 @@ def create_siae_activities(self, siae: Siae): ) department = Perimeter.objects.get(kind=Perimeter.KIND_DEPARTMENT, insee_code=siae.department) siae_activity.locations.add(department) + case _: + self.stdout_warning(f"Unknown geo_range: {siae.geo_range}") + continue siae_activity.sectors.set(siae.sectors.filter(group_id=sector_group_id)) self.stdout_info(f"Created {len(siae_sector_group_ids)} activities for {siae}")