diff --git a/caravel/views.py b/caravel/views.py index f9f5b8a8de..46798db5da 100644 --- a/caravel/views.py +++ b/caravel/views.py @@ -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: diff --git a/caravel/viz.py b/caravel/viz.py index c908e913f6..87e4bf0180 100644 --- a/caravel/viz.py +++ b/caravel/viz.py @@ -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: