From eef264579c63ab657ef1da51895a0e207d7ba4e6 Mon Sep 17 00:00:00 2001 From: Étienne Loks Date: Tue, 3 Nov 2020 13:23:35 +0100 Subject: Import match page: add edit type link - Fix default - Fix for document import --- ishtar_common/data_importer.py | 6 +++++- 1 file changed, 5 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 46b581365..f48651ac7 100644 --- a/ishtar_common/data_importer.py +++ b/ishtar_common/data_importer.py @@ -1435,6 +1435,7 @@ class Importer(object): m2ms = [] many_values = data.pop(attribute) + model = None if hasattr(field_object, 'rel'): model = field_object.rel.to elif hasattr(field_object, 'related_model'): @@ -1768,7 +1769,10 @@ class Importer(object): post_save_keys = [] try: try: - dct = create_dict.copy() + dct = {} + if hasattr(cls, "get_import_defaults"): + dct = cls.get_import_defaults() or {} + dct.update(create_dict.copy()) for key in dct: if callable(dct[key]): dct[key] = dct[key]() -- cgit v1.2.3