From c2a9e2e96038438affe7a601b7680c8fed7848bc Mon Sep 17 00:00:00 2001 From: Arik Fraimovich Date: Thu, 16 Feb 2017 18:16:19 +0200 Subject: [PATCH] Fix: public widget serializer was referncing wrong name --- redash/serializers.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/redash/serializers.py b/redash/serializers.py index a9f3862c..d186e702 100644 --- a/redash/serializers.py +++ b/redash/serializers.py @@ -19,7 +19,7 @@ def public_widget(widget): } if widget.visualization and widget.visualization.id: - query_data = models.QueryResult.query.get(widget.visualization.query.latest_query_data_id).to_dict() + query_data = models.QueryResult.query.get(widget.visualization.query_rel.latest_query_data_id).to_dict() res['visualization'] = { 'type': widget.visualization.type, 'name': widget.visualization.name, @@ -29,8 +29,8 @@ def public_widget(widget): 'created_at': widget.visualization.created_at, 'query': { 'query': ' ', # workaround, as otherwise the query data won't be loaded. - 'name': widget.visualization.query.name, - 'description': widget.visualization.query.description, + 'name': widget.visualization.query_rel.name, + 'description': widget.visualization.query_rel.description, 'options': {}, 'latest_query_data': query_data }