graceguo-supercat closed pull request #4560: [bug] fix shared explore url URL: https://github.com/apache/incubator-superset/pull/4560
This is a PR merged from a forked repository. As GitHub hides the original diff on merge, it is displayed below for the sake of provenance: As this is a foreign pull request (from a fork), the diff is supplied below (as it won't show otherwise due to GitHub magic): diff --git a/superset/views/core.py b/superset/views/core.py index 5b0ee5f3bc..9718d1b416 100755 --- a/superset/views/core.py +++ b/superset/views/core.py @@ -963,6 +963,17 @@ def get_form_data(self, slice_id=None): if request_args_data: form_data.update(json.loads(request_args_data)) + url_id = request.args.get('r') + if url_id: + saved_url = db.session.query(models.Url).filter_by(id=url_id).first() + if saved_url: + url_str = parse.unquote_plus( + saved_url.url.split('?')[1][10:], encoding='utf-8', errors=None) + url_form_data = json.loads(url_str) + # allow form_date in request override saved url + url_form_data.update(form_data) + form_data = url_form_data + if request.args.get('viz_type'): # Converting old URLs form_data = cast_form_data(form_data) @@ -1210,18 +1221,6 @@ def explore(self, datasource_type=None, datasource_id=None): datasource_id, datasource_type = self.datasource_info( datasource_id, datasource_type, form_data) - saved_url = None - url_id = request.args.get('r') - if url_id: - saved_url = db.session.query(models.Url).filter_by(id=url_id).first() - if saved_url: - url_str = parse.unquote_plus( - saved_url.url.split('?')[1][10:], encoding='utf-8', errors=None) - url_form_data = json.loads(url_str) - # allow form_date in request override saved url - url_form_data.update(form_data) - form_data = url_form_data - error_redirect = '/slicemodelview/list/' datasource = ConnectorRegistry.get_datasource( datasource_type, datasource_id, db.session) ---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services