You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@superset.apache.org by jo...@apache.org on 2019/10/14 20:55:38 UTC

[incubator-superset] branch john-bodley--delete-slice-get-form-data created (now da72041)

This is an automated email from the ASF dual-hosted git repository.

johnbodley pushed a change to branch john-bodley--delete-slice-get-form-data
in repository https://gitbox.apache.org/repos/asf/incubator-superset.git.


      at da72041  Update core.py

This branch includes the following new commits:

     new da72041  Update core.py

The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.



[incubator-superset] 01/01: Update core.py

Posted by jo...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

johnbodley pushed a commit to branch john-bodley--delete-slice-get-form-data
in repository https://gitbox.apache.org/repos/asf/incubator-superset.git

commit da72041275e27fd2e976cde6254532870e0a504c
Author: John Bodley <45...@users.noreply.github.com>
AuthorDate: Mon Oct 14 13:55:17 2019 -0700

    Update core.py
---
 superset/views/core.py | 48 ------------------------------------------------
 1 file changed, 48 deletions(-)

diff --git a/superset/views/core.py b/superset/views/core.py
index d5bad8b..2e21b2c 100755
--- a/superset/views/core.py
+++ b/superset/views/core.py
@@ -936,54 +936,6 @@ class Superset(BaseSupersetView):
         session.commit()
         return redirect("/accessrequestsmodelview/list/")
 
-    def get_form_data(self, slice_id=None, use_slice_data=False):
-        form_data = {}
-        post_data = request.form.get("form_data")
-        request_args_data = request.args.get("form_data")
-        # Supporting POST
-        if post_data:
-            form_data.update(json.loads(post_data))
-        # request params can overwrite post body
-        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
-
-        form_data = {
-            k: v for k, v in form_data.items() if k not in FORM_DATA_KEY_BLACKLIST
-        }
-
-        # When a slice_id is present, load from DB and override
-        # the form_data from the DB with the other form_data provided
-        slice_id = form_data.get("slice_id") or slice_id
-        slc = None
-
-        # Check if form data only contains slice_id
-        contains_only_slc_id = not any(key != "slice_id" for key in form_data)
-
-        # Include the slice_form_data if request from explore or slice calls
-        # or if form_data only contains slice_id
-        if slice_id and (use_slice_data or contains_only_slc_id):
-            slc = db.session.query(models.Slice).filter_by(id=slice_id).one_or_none()
-            if slc:
-                slice_form_data = slc.form_data.copy()
-                slice_form_data.update(form_data)
-                form_data = slice_form_data
-
-        update_time_range(form_data)
-
-        return form_data, slc
-
     def get_viz(
         self,
         slice_id=None,