superset-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From maximebeauche...@apache.org
Subject [incubator-superset] branch master updated: asciifying http header for csv download; fixes #3952 (#3975)
Date Tue, 05 Dec 2017 20:05:01 GMT
This is an automated email from the ASF dual-hosted git repository.

maximebeauchemin pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-superset.git


The following commit(s) were added to refs/heads/master by this push:
     new e98a1c3  asciifying http header for csv download; fixes #3952 (#3975)
e98a1c3 is described below

commit e98a1c35378b97702b92396e12845bee1d4d5568
Author: rumbin <rumbin@users.noreply.github.com>
AuthorDate: Tue Dec 5 21:04:58 2017 +0100

    asciifying http header for csv download; fixes #3952 (#3975)
    
    * asciifying http header for csv download; fixes #3952
    
    * fixed order of imports and added unidecode to requirements in setup.py
---
 setup.py               | 1 +
 superset/views/core.py | 3 ++-
 2 files changed, 3 insertions(+), 1 deletion(-)

diff --git a/setup.py b/setup.py
index 1feebf0..b50cf28 100644
--- a/setup.py
+++ b/setup.py
@@ -77,6 +77,7 @@ setup(
         'sqlparse==0.2.3',
         'thrift>=0.9.3',
         'thrift-sasl>=0.2.1',
+        'unidecode>=0.04.21',
     ],
     extras_require={
         'cors': ['Flask-Cors>=2.0.0'],
diff --git a/superset/views/core.py b/superset/views/core.py
index fc63391..d1219ea 100755
--- a/superset/views/core.py
+++ b/superset/views/core.py
@@ -28,6 +28,7 @@ import pandas as pd
 import sqlalchemy as sqla
 from sqlalchemy import create_engine
 from sqlalchemy.engine.url import make_url
+from unidecode import unidecode
 from werkzeug.routing import BaseConverter
 from werkzeug.utils import secure_filename
 
@@ -2283,7 +2284,7 @@ class Superset(BaseSupersetView):
             csv = df.to_csv(index=False, **config.get('CSV_EXPORT'))
         response = Response(csv, mimetype='text/csv')
         response.headers['Content-Disposition'] = (
-            'attachment; filename={}.csv'.format(query.name))
+            'attachment; filename={}.csv'.format(unidecode(query.name)))
         logging.info('Ready to return response')
         return response
 

-- 
To stop receiving notification emails like this one, please contact
['"commits@superset.apache.org" <commits@superset.apache.org>'].

Mime
View raw message