From 0840bffda966fd8ba60e48b8fb4a779f3a772015 Mon Sep 17 00:00:00 2001 From: "John N. Milner" Date: Thu, 25 Jan 2024 16:52:20 -0500 Subject: [PATCH] Properly expand select_one_from_file MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit …to `select_one_from_file file.csv` instead of having `select_one_from_file` in the `type` column and `file.csv` in a nonstandard `file` column. Fixes a problem introduced in #314 --- src/formpack/utils/flatten_content.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/formpack/utils/flatten_content.py b/src/formpack/utils/flatten_content.py index ca6359e3..c9a8d896 100644 --- a/src/formpack/utils/flatten_content.py +++ b/src/formpack/utils/flatten_content.py @@ -251,3 +251,6 @@ def _flatten_survey_row(row): row['type'] = '{} {} or_other'.format(_type, _list_name) else: row['type'] = '{} {}'.format(_type, _list_name) + elif row['type'] == 'select_one_from_file' and 'file' in row: + _file = row.pop('file') + row['type'] = '{} {}'.format(_type, _file)