diff options
-rw-r--r-- | ishtar_common/data_importer.py | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/ishtar_common/data_importer.py b/ishtar_common/data_importer.py index 04782a56e..e222fa0f3 100644 --- a/ishtar_common/data_importer.py +++ b/ishtar_common/data_importer.py @@ -1338,7 +1338,9 @@ class Importer(object): obj.save() self._add_to_post_save(obj.__class__, obj.pk, idx_line) - if self.TYPE == "gis": + GeoVectorData = apps.get_model("ishtar_common", "GeoVectorData") + if self.TYPE == "gis" and not isinstance(obj, GeoVectorData): + # create GIS data and attach to the created object if the object is not GIS if not obj and not self.c_errors: self.c_errors = True self.errors.append( @@ -1349,7 +1351,6 @@ class Importer(object): ) ) return - content_type = ContentType.objects.get( app_label=obj.__class__._meta.app_label, model=obj.__class__.__name__.lower() @@ -1358,7 +1359,6 @@ class Importer(object): "source_id": obj.pk, "source_content_type": content_type, }) - GeoVectorData = apps.get_model("ishtar_common", "GeoVectorData") item = None created = False if "import_key" in geodata: |