Use normalized length of record name

This is needed in case the client normalize the report name before storing to
the filesystem.

issue10986
review381471003
This commit is contained in:
Adrià Tarroja Caubet
2021-12-18 01:37:06 +01:00
parent 91f8217557
commit 7e0a5db4ac
+3 -1
View File
@@ -9,6 +9,7 @@ import os
import subprocess
import tempfile
import time
import unicodedata
import warnings
import zipfile
from email.mime.multipart import MIMEMultipart
@@ -174,7 +175,8 @@ class Report(URLMixin, PoolBase):
record_name = template.generate(record=record).render()
else:
record_name = record.rec_name
name_length += len(record_name) + 1
name_length += len(
unicodedata.normalize('NFKD', record_name)) + 1
if name_length > max_length:
break
names.append(record_name)