diff options
| author | Étienne Loks <etienne.loks@iggdrasil.net> | 2026-06-28 16:00:10 +0200 |
|---|---|---|
| committer | Étienne Loks <etienne.loks@iggdrasil.net> | 2026-06-28 22:09:50 +0200 |
| commit | ff93a30f7cb925ebeab951be3458a2669f9e4a4a (patch) | |
| tree | 636d8848b2e3faa13b6caa5d62967eb0e87b439f | |
| parent | 475ff9933d56ae020f1854ff495d4efe89617e0c (diff) | |
| download | Ishtar-ff93a30f7cb925ebeab951be3458a2669f9e4a4a.tar.bz2 Ishtar-ff93a30f7cb925ebeab951be3458a2669f9e4a4a.zip | |
🚑️ search vector: fix update vector with JSON data list
| -rw-r--r-- | ishtar_common/models_common.py | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/ishtar_common/models_common.py b/ishtar_common/models_common.py index de1de3a91..d4a8cb521 100644 --- a/ishtar_common/models_common.py +++ b/ishtar_common/models_common.py @@ -1290,7 +1290,14 @@ class FullSearch(models.Model): datas = [data] if json_field.value_type == "MC": datas = data + new_datas = [] for d in datas: + # flatify lists + if not isinstance(d, (list, tuple)): + new_datas.append(d) + continue + new_datas += [v for v in d if v not in (None, "")] + for d in new_datas: for lang in ("simple", settings.ISHTAR_SEARCH_LANGUAGE): with connection.cursor() as cursor: cursor.execute("SELECT to_tsvector(%s, %s)", [lang, d]) |
