Skip to content

Commit

Permalink
fix: csv export
Browse files Browse the repository at this point in the history
  • Loading branch information
francesco-filicetti committed Mar 28, 2024
1 parent a2a5d3f commit e2b9bda
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions uniticket/uni_ticket/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -595,7 +595,7 @@ def export_input_module_csv(
]
row.append(getattr(richiesta.created_by, EMPLOYEE_ATTRIBUTE_NAME))
row.append(getattr(richiesta.created_by, USER_ATTRIBUTE_NAME))
row.extend([status, richiesta.subject, richiesta.description])
row.extend([status, richiesta.subject, re.sub('(\r\n|\r)$', '\\n', richiesta.description)])

for column in custom_head:
name = format_field_name(column)
Expand All @@ -606,16 +606,16 @@ def export_input_module_csv(
found = re.search(settings.FORMSET_REGEX.format(name), k)
if found:
if for_index != 0:
match_list += "\n"
match_list += "\\n"
if int(found.group("index")) > formset_index:
match_list += "\n"
match_list += "\\n"
formset_index += 1
for_index += 1
match_list += "{}: {}".format(found.group("name"), v)
match_list += "{}: {}".format(found.group("name"), re.sub('(\r\n|\r)$', '\\n', v))
if match_list:
row.append(match_list)
else:
row.append(content.get(name, ""))
row.append(re.sub('(\r\n|\r)$', '\\n', content.get(name, "")n))
writer.writerow(row)
return csv_file

Expand Down

0 comments on commit e2b9bda

Please sign in to comment.