From 7f5b204f3b613bb7abfe18f6e47e92884cf2cd3b Mon Sep 17 00:00:00 2001 From: Étienne Loks Date: Tue, 26 Mar 2019 11:04:50 +0100 Subject: Step by step import: fix JSON data update check --- ishtar_common/data_importer.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'ishtar_common/data_importer.py') diff --git a/ishtar_common/data_importer.py b/ishtar_common/data_importer.py index 4eb403c44..67aa402b8 100644 --- a/ishtar_common/data_importer.py +++ b/ishtar_common/data_importer.py @@ -1721,6 +1721,7 @@ class Importer(object): else: dct.pop(k) + obj = None if self.simulate: q = cls.objects.filter(**dct) if not q.count(): @@ -1780,7 +1781,7 @@ class Importer(object): new_val = dct['defaults'][k] if new_val is None or new_val == '': continue - if k == 'data': + if obj and k == 'data': updated_dct[k] = update_data(obj.data, new_val) else: -- cgit v1.2.3