[hotfix] csv and json link are off (#592)

* Fixing bugs

* [hotfix] csv and json link are off
This commit is contained in:
Maxime Beauchemin 2016-06-09 18:06:20 -07:00 committed by GitHub
parent 60ed3e4050
commit c35e0e831c
2 changed files with 2 additions and 5 deletions

View File

@ -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:

View File

@ -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: