summaryrefslogtreecommitdiff
path: root/ishtar_common/data_importer.py
diff options
context:
space:
mode:
authorÉtienne Loks <etienne.loks@iggdrasil.net>2017-07-26 15:05:09 +0200
committerÉtienne Loks <etienne.loks@iggdrasil.net>2017-07-26 15:05:09 +0200
commit8801ab7b7e655d8b831e535381eeea8adc091989 (patch)
treefd1cfe512c94affdfae65e7ec3078648eabffbd7 /ishtar_common/data_importer.py
parentc42486f81b042d18b9cf825da9f35a83e00bc051 (diff)
parent005f3962ab8d0eef66de6dd335f619702107116a (diff)
downloadIshtar-8801ab7b7e655d8b831e535381eeea8adc091989.tar.bz2
Ishtar-8801ab7b7e655d8b831e535381eeea8adc091989.zip
Merge branch 'master' into v0.9
Diffstat (limited to 'ishtar_common/data_importer.py')
-rw-r--r--ishtar_common/data_importer.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/ishtar_common/data_importer.py b/ishtar_common/data_importer.py
index e11e72449..3bb65fc21 100644
--- a/ishtar_common/data_importer.py
+++ b/ishtar_common/data_importer.py
@@ -1415,8 +1415,7 @@ class Importer(object):
if attribute != '__force_new':
self.get_field(cls, attribute, data, m2ms, c_c_path,
new_created)
- except (ValueError, IntegrityError) as e:
- message = e.message
+ except (ValueError, IntegrityError, FieldDoesNotExist) as e:
try:
message = e.message.decode('utf-8')
except (UnicodeDecodeError, UnicodeDecodeError):
@@ -1538,6 +1537,9 @@ class Importer(object):
if m2ms:
# force post save script
obj.save()
+ if hasattr(obj, 'fix'):
+ # post save/m2m specific fix
+ obj.fix()
except IntegrityError as e:
message = e.message
try: