From 5b35d5ba7e689fefb36d5af169bf0b162463708d Mon Sep 17 00:00:00 2001 From: Étienne Loks Date: Thu, 3 Apr 2025 17:38:15 +0200 Subject: 🐛 fix csv export with '|' syntax for export columns - ✅ test find csv export MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ishtar_common/views_item.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'ishtar_common/views_item.py') diff --git a/ishtar_common/views_item.py b/ishtar_common/views_item.py index 3a2fb8136..82548932f 100644 --- a/ishtar_common/views_item.py +++ b/ishtar_common/views_item.py @@ -3216,8 +3216,10 @@ def get_item( if len(data[1:]) <= idx + delta: break val = data[1:][idx + delta] - if col_name and "|" in col_name[0]: - for delta_idx in range(len(col_name[0].split("|")) - 1): + ccol_name = col_name[0] if isinstance(col_name, (list, tuple)) else col_name + if ccol_name and "|" in ccol_name: + nb_sub_cols = len(ccol_name.split("|")) + for delta_idx in range(nb_sub_cols - 1): delta += 1 val += data[1:][idx + delta] row.append(val) -- cgit v1.2.3