Skip to content
Snippets Groups Projects
Commit b18c5df8 authored by Daniel Hornung's avatar Daniel Hornung
Browse files

FIX: Regression from handling of illegal characters.

parent 973f9928
No related branches found
No related tags found
2 merge requests!100WIP: Filling XLSX: Seems to be working.,!93Filling XLSX: Everything except multiple choice.
Pipeline #49026 failed
......@@ -3,6 +3,7 @@
src/caosadvancedtools/version.py
# compiled python and dist stuff
.venv
*.egg
.eggs
*.egg-info/
......
......@@ -308,8 +308,13 @@ out: union[dict, None]
# collecting the data
assert isinstance(content, list)
content = [str(x) for x in content]
value = ";".join(content) # TODO we need escaping of values
if len(content) > 1:
content = [ILLEGAL_CHARACTERS_RE.sub("", str(x)) for x in content]
value = ";".join(content) # TODO we need escaping of values
else:
value = content[0]
if isinstance(value, str):
value = ILLEGAL_CHARACTERS_RE.sub("", value)
path_str = p2s(path)
assert path_str not in insertables
insertables[path_str] = value
......@@ -333,8 +338,7 @@ out: union[dict, None]
if insert_row is None:
insert_row = _next_row_index(sheet)
sheet.cell(row=insert_row+1, column=col_index+1,
value=ILLEGAL_CHARACTERS_RE.sub("", value))
sheet.cell(row=insert_row+1, column=col_index+1, value=value)
# Insert foreign keys
if insert_row is not None and sheet is not None and _is_exploded_sheet(sheet):
......@@ -345,8 +349,7 @@ out: union[dict, None]
raise
for index, path in ((f.index, f.path) for f in foreigns.values()):
value = context[path]
sheet.cell(row=insert_row+1, column=index+1,
value=ILLEGAL_CHARACTERS_RE.sub("", value))
sheet.cell(row=insert_row+1, column=index+1, value=value)
return None
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment