superset-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From grace...@apache.org
Subject [incubator-superset] branch master updated: [bug] fix shortener url (#4560)
Date Wed, 07 Mar 2018 18:57:35 GMT
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 <grace.guo@airbnb.com>
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.

Mime
View raw message