diff options
author | Étienne Loks <etienne.loks@iggdrasil.net> | 2021-11-03 21:50:47 +0100 |
---|---|---|
committer | Étienne Loks <etienne.loks@iggdrasil.net> | 2022-07-08 09:58:49 +0200 |
commit | b97cceab25f6d5a5b12dcf6a40f4a4775ebeea5d (patch) | |
tree | 0981c0e806d4a528c56ab494971995c8f0787052 /ishtar_common/wizards.py | |
parent | 3c5ed0f4ca035fa3e9334498a227f4d4cf69ed1d (diff) | |
download | Ishtar-b97cceab25f6d5a5b12dcf6a40f4a4775ebeea5d.tar.bz2 Ishtar-b97cceab25f6d5a5b12dcf6a40f4a4775ebeea5d.zip |
JSON types: multi valued choices - fix search index and last panel
Diffstat (limited to 'ishtar_common/wizards.py')
-rw-r--r-- | ishtar_common/wizards.py | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/ishtar_common/wizards.py b/ishtar_common/wizards.py index 38afa0bfb..9b0ffb48a 100644 --- a/ishtar_common/wizards.py +++ b/ishtar_common/wizards.py @@ -463,7 +463,6 @@ class Wizard(IshtarWizard): else: value = _("No") elif key in associated_models: - values = [] if type(value) in (tuple, list): values = value elif "," in str(value): @@ -479,6 +478,12 @@ class Wizard(IshtarWizard): value = str(item) rendered_values.append(value) value = " ; ".join(rendered_values) + if key.startswith("data__"): + if isinstance(value, list): + value = ", ".join(value) + if value.startswith("[") and value.endswith("]"): + value = " ; ".join( + [v.strip()[1:-1] for v in value[1:-1].split(",")]) current_form_data.append((lbl, value, "")) if is_formset: |