From commits-return-731-archive-asf-public=cust-asf.ponee.io@superset.incubator.apache.org Wed Mar 7 19:57:37 2018 Return-Path: X-Original-To: archive-asf-public@cust-asf.ponee.io Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by mx-eu-01.ponee.io (Postfix) with SMTP id 0465F180676 for ; Wed, 7 Mar 2018 19:57:36 +0100 (CET) Received: (qmail 78691 invoked by uid 500); 7 Mar 2018 18:57:36 -0000 Mailing-List: contact commits-help@superset.incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@superset.incubator.apache.org Delivered-To: mailing list commits@superset.incubator.apache.org Received: (qmail 78681 invoked by uid 99); 7 Mar 2018 18:57:36 -0000 Received: from ec2-52-202-80-70.compute-1.amazonaws.com (HELO gitbox.apache.org) (52.202.80.70) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 07 Mar 2018 18:57:36 +0000 Received: by gitbox.apache.org (ASF Mail Server at gitbox.apache.org, from userid 33) id 938A880680; Wed, 7 Mar 2018 18:57:35 +0000 (UTC) Date: Wed, 07 Mar 2018 18:57:35 +0000 To: "commits@superset.apache.org" Subject: [incubator-superset] branch master updated: [bug] fix shortener url (#4560) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Message-ID: <152044905544.14553.15597818799846314170@gitbox.apache.org> From: graceguo@apache.org X-Git-Host: gitbox.apache.org X-Git-Repo: incubator-superset X-Git-Refname: refs/heads/master X-Git-Reftype: branch X-Git-Oldrev: b63dc91cd187de0fd503a205800c9e092db88d8e X-Git-Newrev: 369f652bfc4aef377de33eda2c5559e6f0c5c442 X-Git-Rev: 369f652bfc4aef377de33eda2c5559e6f0c5c442 X-Git-NotificationType: ref_changed_plus_diff X-Git-Multimail-Version: 1.5.dev Auto-Submitted: auto-generated This is an automated email from the ASF dual-hosted git repository. graceguo pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/incubator-superset.git The following commit(s) were added to refs/heads/master by this push: new 369f652 [bug] fix shortener url (#4560) 369f652 is described below commit 369f652bfc4aef377de33eda2c5559e6f0c5c442 Author: Grace Guo AuthorDate: Wed Mar 7 10:57:33 2018 -0800 [bug] fix shortener url (#4560) [bug] fix shared explore url --- superset/views/core.py | 23 +++++++++++------------ 1 file changed, 11 insertions(+), 12 deletions(-) diff --git a/superset/views/core.py b/superset/views/core.py index 5b0ee5f..9718d1b 100755 --- a/superset/views/core.py +++ b/superset/views/core.py @@ -963,6 +963,17 @@ class Superset(BaseSupersetView): 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 @@ class Superset(BaseSupersetView): 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) -- To stop receiving notification emails like this one, please contact graceguo@apache.org.