mirror of
https://github.com/apache/superset.git
synced 2024-09-12 08:39:45 -04:00
[hotfix] csv and json link are off (#592)
* Fixing bugs * [hotfix] csv and json link are off
This commit is contained in:
parent
60ed3e4050
commit
c35e0e831c
@ -728,11 +728,10 @@ class Caravel(BaseView):
|
||||
mimetype="application/json")
|
||||
return resp
|
||||
elif request.args.get("csv") == "true":
|
||||
status = 200
|
||||
payload = obj.get_csv()
|
||||
return Response(
|
||||
payload,
|
||||
status=status,
|
||||
status=200,
|
||||
headers=generate_download_headers("csv"),
|
||||
mimetype="application/csv")
|
||||
else:
|
||||
|
@ -80,11 +80,9 @@ class BaseViz(object):
|
||||
defaults.update(data)
|
||||
self.form_data = defaults
|
||||
self.query = ""
|
||||
|
||||
self.form_data['previous_viz_type'] = self.viz_type
|
||||
self.token = self.form_data.get(
|
||||
'token', 'token_' + uuid.uuid4().hex[:8])
|
||||
|
||||
self.metrics = self.form_data.get('metrics') or []
|
||||
self.groupby = self.form_data.get('groupby') or []
|
||||
self.reassignments()
|
||||
@ -105,7 +103,7 @@ class BaseViz(object):
|
||||
|
||||
def get_url(self, **kwargs):
|
||||
"""Returns the URL for the viz"""
|
||||
d = self.orig_form_data.copy()
|
||||
d = self.form_data.copy()
|
||||
if 'json' in d:
|
||||
del d['json']
|
||||
if 'action' in d:
|
||||
|
Loading…
Reference in New Issue
Block a user