From 0c5b55333cfe3d9a04f377ae671c5bfad4baf6a0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?No=C3=ABl=20Martinon?= Date: Thu, 10 Oct 2024 07:38:37 -0400 Subject: [PATCH] Fix 'loadinfrastructure' condition adding to infra without 'eid-field' option --- .../infrastructure/management/commands/loadinfrastructure.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/geotrek/infrastructure/management/commands/loadinfrastructure.py b/geotrek/infrastructure/management/commands/loadinfrastructure.py index 5ddde1a4d2..fe13537668 100644 --- a/geotrek/infrastructure/management/commands/loadinfrastructure.py +++ b/geotrek/infrastructure/management/commands/loadinfrastructure.py @@ -232,6 +232,8 @@ def create_infrastructure(self, geometry, name, type, category, use_structure, self.stdout.write("Update : %s with eid %s" % (name, eid)) else: infra = Infrastructure.objects.create(**fields_without_eid) + if condition_type: + infra.conditions.add(condition_type) if settings.TREKKING_TOPOLOGY_ENABLED: try: geometry.coord_dim = 2