You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@superset.apache.org by GitBox <gi...@apache.org> on 2018/12/03 18:36:59 UTC
[GitHub] graceguo-supercat commented on a change in pull request #6449:
[fix] url shortner for long explore url
graceguo-supercat commented on a change in pull request #6449: [fix] url shortner for long explore url
URL: https://github.com/apache/incubator-superset/pull/6449#discussion_r237185257
##########
File path: superset/views/core.py
##########
@@ -758,8 +758,13 @@ class R(BaseSupersetView):
@expose('/<url_id>')
def index(self, url_id):
url = db.session.query(models.Url).filter_by(id=url_id).first()
- if url:
- return redirect('/' + url.url)
+ if url and url.url:
+ explore_url = '//superset/explore/?'
+ if url.url.startswith(explore_url):
+ explore_url += 'r={}'.format(url_id)
+ return redirect('/' + explore_url)
Review comment:
how about redirect to relative path: redirect ('/superset/explore/?r=423'). Tested in current commit, it works for both dashboard and explore url.
----------------------------------------------------------------
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:
users@infra.apache.org
With regards,
Apache Git Services
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org