summaryrefslogtreecommitdiff
path: root/ishtar_common
diff options
context:
space:
mode:
authorÉtienne Loks <etienne.loks@iggdrasil.net>2025-01-23 17:42:34 +0100
committerÉtienne Loks <etienne.loks@iggdrasil.net>2025-02-19 14:45:56 +0100
commit0a9419ffefff9ba43ecb75d579deb958042f21d5 (patch)
treee42fd1e7cc30d86cea1acc903eb5a3f8b6d06c57 /ishtar_common
parentcba538fc4dc3a2002c119933144375232c912cbb (diff)
downloadIshtar-0a9419ffefff9ba43ecb75d579deb958042f21d5.tar.bz2
Ishtar-0a9419ffefff9ba43ecb75d579deb958042f21d5.zip
🗃️ treatments: other_reference -> reference - find_treatments : m2m imports links - ✨ Treatment: upstream_count property - change default find external ID with upstream count
Diffstat (limited to 'ishtar_common')
-rw-r--r--ishtar_common/admin.py2
-rw-r--r--ishtar_common/data_importer.py5
-rw-r--r--ishtar_common/models.py2
3 files changed, 6 insertions, 3 deletions
diff --git a/ishtar_common/admin.py b/ishtar_common/admin.py
index cc26d6253..7b1aa48d4 100644
--- a/ishtar_common/admin.py
+++ b/ishtar_common/admin.py
@@ -2129,7 +2129,7 @@ serialize_importer_group_action.short_description = SERIALIZE_DESC
@admin.register(models.ImporterGroup, site=admin_site)
-class ImporterTypeAdmin(admin.ModelAdmin):
+class ImporterGroupAdmin(ImportJSONActionAdmin):
list_display = ("name", "importer_types_label", "available")
actions = [
serialize_importer_group_action,
diff --git a/ishtar_common/data_importer.py b/ishtar_common/data_importer.py
index 7717c0e03..defea4da8 100644
--- a/ishtar_common/data_importer.py
+++ b/ishtar_common/data_importer.py
@@ -1315,6 +1315,9 @@ class Importer(object):
if self.import_instance:
self.import_instance.add_imported_line(self.idx_line)
+ if not obj:
+ return
+
if self.import_instance:
if created:
obj.imports.add(self.import_instance)
@@ -2137,7 +2140,7 @@ class Importer(object):
and type(new_val) == str
):
updated_dct[k] = val + "\n" + new_val
- else:
+ elif "defaults" in dct:
for k in dct["defaults"]:
new_val = dct["defaults"][k]
if new_val is None or new_val == "":
diff --git a/ishtar_common/models.py b/ishtar_common/models.py
index 9197a67bf..5b4620254 100644
--- a/ishtar_common/models.py
+++ b/ishtar_common/models.py
@@ -1388,7 +1388,7 @@ class IshtarSiteProfile(models.Model, Cached):
)
find_external_id = models.TextField(
_("Find external id"),
- default="{get_first_base_find__context_record__external_id}-{label}",
+ default="{{get_first_base_find__context_record__external_id}}-{{label}}{% if upstream_count %}-{{upstream_count}}{% endif %}",
help_text=_(
"Formula to manage find external ID. "
"Change this with care. With incorrect formula, the "