diff options
| -rw-r--r-- | example_project/settings.py | 2 | ||||
| -rw-r--r-- | ishtar_common/models_common.py | 5 | 
2 files changed, 6 insertions, 1 deletions
diff --git a/example_project/settings.py b/example_project/settings.py index 4830abe42..33372bd5d 100644 --- a/example_project/settings.py +++ b/example_project/settings.py @@ -262,6 +262,8 @@ ISHTAR_SLUGS = {      "document-publisher": ["publisher"],  } +ISHTAR_MIGRATE_V4 = False +  SRID = 4326  # WGS84 - World  SURFACE_SRID = 4326  # WGS84 - World  ENCODING = "windows-1252" diff --git a/ishtar_common/models_common.py b/ishtar_common/models_common.py index ebee974ff..1db38fbb5 100644 --- a/ishtar_common/models_common.py +++ b/ishtar_common/models_common.py @@ -2656,6 +2656,9 @@ def geodata_attached_remove(model, instance, pk_set=None, clear=False):  def geodata_attached_changed(sender, **kwargs): +    if getattr(settings, "ISHTAR_MIGRATE_V4", False): +        # disable on first migration +        return      # manage main geoitem and cascade association      profile = get_current_profile()      if not profile.mapping: @@ -2672,7 +2675,7 @@ def geodata_attached_changed(sender, **kwargs):          instance_pk = instance.pk          instance = model.objects.get(pk=list(pk_set)[0])          model = GeoVectorData -        pk_set = set([instance_pk]) +        pk_set = {instance_pk}      if action == "post_add":          geodata_attached_post_add(model, instance, pk_set)  | 
