williaster commented on a change in pull request #3993: [Explore view] Use POST
method for charting requests
URL:
https://github.com/apache/incubator-superset/pull/3993#discussion_r156473637
##########
File path: superset/views/core.py
##########
@@ -1124,18 +1125,32 @@ def explorev2(self, datasource_type, datasource_id):
@log_this
@has_access
- @expose('/explore/<datasource_type>/<datasource_id>/')
+ @expose('/explore/<datasource_type>/<datasource_id>/', methods=['GET',
'POST'])
def explore(self, datasource_type, datasource_id):
- form_data = self.get_form_data()
-
datasource_id = int(datasource_id)
- viz_type = form_data.get('viz_type')
- slice_id = form_data.get('slice_id')
user_id = g.user.get_id() if g.user else None
+ form_data = self.get_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
+
+ slice_id = form_data.get('slice_id')
slc = None
if slice_id:
Review comment:
probably not ever really an issue but should this technically be a `elif`
now / mutually exclusive with the shortened 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:
[email protected]
With regards,
Apache Git Services