Skip to content

Commit

Permalink
[hotfix] csv and json link are off (#592)
Browse files Browse the repository at this point in the history
* Fixing bugs

* [hotfix] csv and json link are off
  • Loading branch information
mistercrunch authored Jun 10, 2016
1 parent 60ed3e4 commit c35e0e8
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 5 deletions.
3 changes: 1 addition & 2 deletions caravel/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -728,11 +728,10 @@ def explore(self, datasource_type, datasource_id):
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:
Expand Down
4 changes: 1 addition & 3 deletions caravel/viz.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,11 +80,9 @@ def __init__(self, datasource, form_data, slice_=None):
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()
Expand All @@ -105,7 +103,7 @@ def reassignments(self):

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:
Expand Down

0 comments on commit c35e0e8

Please sign in to comment.