You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is your feature request related to a problem? Please describe.
In our model not all reviewers have access to the submissions in indicio. For the review we export all the abstracts to a spreadsheet and ask reviewers to vote in the spreadsheet. Unfortunately, exporting CSV/XLSX from event/N/manage/abstracts/list/ does not allow to include the abstract text in the generated spreadsheet.
Describe the solution you'd like
I would like to be able to see the abstract text in the exported CSV/XLSX when the "Contents" button is pressed in "Customize list" in abstracts list form. I.e. if event/N/manage/abstracts/list/ shows the abstract content, then exporting abstracts to CSV/XLSX will include the abstract text.
For our indico setup I've added the patch below as a temporal solution, but it mangles some characters because I didn't find how to correctly put abstract.description to the generated spreadsheet.
From fbb27612aa86a508fc10179a7ef0adf85749e6bb Mon Sep 17 00:00:00 2001
From: Mike Rapoport <rppt@kernel.org>
Date: Sat, 21 May 2022 22:49:55 +0300
Subject: [PATCH] LPC: add abstract contents to CSV and XLSX exports
---
indico/modules/events/abstracts/util.py | 1 +
1 file changed, 1 insertion(+)
diff --git a/indico/modules/events/abstracts/util.py b/indico/modules/events/abstracts/util.py
index faea32873f..8d09b5956a 100644
--- a/indico/modules/events/abstracts/util.py
+++ b/indico/modules/events/abstracts/util.py
@@ -70,6 +70,7 @@ def generate_spreadsheet_from_abstracts(abstracts, static_item_ids, dynamic_item
'score': ('Score', lambda x: round(x.score, 1) if x.score is not None else None),
'submitted_dt': ('Submission date', lambda x: x.submitted_dt),
'modified_dt': ('Modification date', lambda x: x.modified_dt if x.modified_dt else ''),
+ 'description': ('Content', lambda x: x.description),
}
field_names.extend(unique_col(item.title, item.id) for item in dynamic_items)
field_names.extend(title for name, (title, fn) in static_item_mapping.items() if name in static_item_ids)
--
2.34.1
The text was updated successfully, but these errors were encountered:
This change looks good. My guess is that the "mangling" you experienced comes from this sanitization we apply to data that goes into CSV files:
def_prepare_csv_data(data, _linebreak_re=re.compile(r'(\r?\n)+'), _dangerous_chars_re=re.compile(r'^[=+@-]+')):
ifisinstance(data, (list, tuple)):
data='; '.join(data)
elifisinstance(data, set):
data='; '.join(sorted(data, key=str.lower))
elifisinstance(data, bool):
data='Yes'ifdataelse'No'elifdataisNone:
data=''data=_linebreak_re.sub(' ', str(data))
# https://www.owasp.org/index.php/CSV_Injection# quoting the cell's value does NOT mitigate this, so we need to strip# those characters from the beginning...return_dangerous_chars_re.sub('', data)
However, this seems acceptable - if someone wants something that's exactly the same, they can use the Excel (XLSX) export instead.. CSV is not well-suited for multi-line content.
I will open a PR containing your commit and merge it once CI passed.
Is your feature request related to a problem? Please describe.
In our model not all reviewers have access to the submissions in indicio. For the review we export all the abstracts to a spreadsheet and ask reviewers to vote in the spreadsheet. Unfortunately, exporting CSV/XLSX from
event/N/manage/abstracts/list/
does not allow to include the abstract text in the generated spreadsheet.Describe the solution you'd like
I would like to be able to see the abstract text in the exported CSV/XLSX when the "Contents" button is pressed in "Customize list" in abstracts list form. I.e. if
event/N/manage/abstracts/list/
shows the abstract content, then exporting abstracts to CSV/XLSX will include the abstract text.For our indico setup I've added the patch below as a temporal solution, but it mangles some characters because I didn't find how to correctly put
abstract.description
to the generated spreadsheet.The text was updated successfully, but these errors were encountered: