Skip to content

Commit 63ec1f5

Browse files
committed
[FIX] l10n_it_account: do not fail conversion on empty field
We don't want XML generation to fail if a field is empty (i.e. False) Once it's time to validate the XML, the system will produce a more meaningful and human-readable error.
1 parent a7408f3 commit 63ec1f5

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

l10n_it_account/tools/account_tools.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@
1414

1515

1616
def encode_for_export(string_to_encode, max_chars, encoding="latin"):
17+
if not string_to_encode:
18+
return ""
1719
return (
1820
reg_whitespace.sub(" ", string_to_encode)
1921
.encode(encoding, errors="replace")

0 commit comments

Comments
 (0)