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 2020/07/25 02:41:46 UTC

[incubator-superset] branch john-bodley--remove-scoped-session created (now 336ff83)

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

johnbodley pushed a change to branch john-bodley--remove-scoped-session
in repository https://gitbox.apache.org/repos/asf/incubator-superset.git.


      at 336ff83  chore: Removing explicit scoped session

This branch includes the following new commits:

     new 336ff83  chore: Removing explicit scoped session

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: chore: Removing explicit scoped session

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--remove-scoped-session
in repository https://gitbox.apache.org/repos/asf/incubator-superset.git

commit 336ff8310d7879622a86663ae8c01e5f0749ac9e
Author: John Bodley <45...@users.noreply.github.com>
AuthorDate: Fri Jul 24 19:41:25 2020 -0700

    chore: Removing explicit scoped session
---
 superset/views/base.py | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/superset/views/base.py b/superset/views/base.py
index 7aeae79..58c4943 100644
--- a/superset/views/base.py
+++ b/superset/views/base.py
@@ -487,8 +487,7 @@ def check_ownership(obj: Any, raise_if_false: bool = True) -> bool:
     roles = [r.name for r in get_user_roles()]
     if "Admin" in roles:
         return True
-    scoped_session = db.create_scoped_session()
-    orig_obj = scoped_session.query(obj.__class__).filter_by(id=obj.id).first()
+    orig_obj = db.session.query(obj.__class__).filter_by(id=obj.id).first()
 
     # Making a list of owners that works across ORM models
     owners: List[User] = []