fix: attachment filename error in sqllab with i18n (#11762)
* Fix attachment filename error in sqllab * Fix line too long lint * Fix black lint
This commit is contained in:
parent
38f67a44ca
commit
ac0dd3fa32
|
|
@ -2474,9 +2474,11 @@ class Superset(BaseSupersetView): # pylint: disable=too-many-public-methods
|
|||
# TODO(bkyryliuk): add compression=gzip for big files.
|
||||
csv = df.to_csv(index=False, **config["CSV_EXPORT"])
|
||||
response = Response(csv, mimetype="text/csv")
|
||||
response.headers[
|
||||
"Content-Disposition"
|
||||
] = f"attachment; filename={query.name}.csv"
|
||||
quoted_csv_name = parse.quote(query.name)
|
||||
response.headers["Content-Disposition"] = (
|
||||
f'attachment; filename="{quoted_csv_name}.csv"; '
|
||||
f"filename*=UTF-8''{quoted_csv_name}.csv"
|
||||
)
|
||||
event_info = {
|
||||
"event_type": "data_export",
|
||||
"client_id": client_id,
|
||||
|
|
|
|||
Loading…
Reference in New Issue