mirror of
https://github.com/pretix/pretix.git
synced 2026-05-06 15:24:02 +00:00
xlsx-export: decode bytes-array for checking on illegal chars (#2062)
This commit is contained in:
committed by
GitHub
parent
4796616578
commit
f2e2b5cb86
@@ -56,6 +56,9 @@ def excel_safe(val):
|
||||
if not isinstance(val, KNOWN_TYPES):
|
||||
val = str(val)
|
||||
|
||||
if isinstance(val, bytes):
|
||||
val = val.decode("utf-8", errors="ignore")
|
||||
|
||||
if isinstance(val, str):
|
||||
val = re.sub(ILLEGAL_CHARACTERS_RE, '', val)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user