diff options
| -rw-r--r-- | CHANGES.md | 1 | ||||
| -rw-r--r-- | ishtar_common/data_importer.py | 16 | 
2 files changed, 11 insertions, 6 deletions
| diff --git a/CHANGES.md b/CHANGES.md index 77db18ed7..2412157e1 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -8,6 +8,7 @@ WIP  ### Improvements ###  - Context record: add Unit to indexed search +- Admin: small improvements on syndication  ### Bug fixes ###  - Fix redirect URL after logout diff --git a/ishtar_common/data_importer.py b/ishtar_common/data_importer.py index 63a8d65cf..5b3509b3e 100644 --- a/ishtar_common/data_importer.py +++ b/ishtar_common/data_importer.py @@ -1453,12 +1453,16 @@ class Importer(object):                  )                  if q.count():                      item = q.all()[0] -            if item: -                for k in geodata: -                    setattr(item, k, geodata[k]) -                item.save() -            else: -                item = GeoVectorData.objects.create(**geodata) +            try: +                if item: +                    for k in geodata: +                        setattr(item, k, geodata[k]) +                    item.save() +                else: +                    item = GeoVectorData.objects.create(**geodata) +            except Exception as e: +                self.errors.append((self.idx_line, None, str(e))) +                return              if self.import_instance:                  item.imports.add(self.import_instance)              if self.MAIN_GEO: | 
