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 2020/06/25 11:08:11 UTC

[GitHub] [incubator-superset] dpgaspar commented on a change in pull request #10146: refactor: Using self.get_session in security manager

dpgaspar commented on a change in pull request #10146:
URL: https://github.com/apache/incubator-superset/pull/10146#discussion_r445479954



##########
File path: superset/security/manager.py
##########
@@ -389,15 +389,11 @@ def get_public_role(self) -> Optional[Any]:  # Optional[self.role_model]
         if not conf.get("PUBLIC_ROLE_LIKE_GAMMA", False):
             return None
 
-        from superset import db
-
-        return db.session.query(self.role_model).filter_by(name="Public").first()
+        return self.get_session.query(self.role_model).filter_by(name="Public").first()

Review comment:
       `return self.get_session.query(self.role_model).filter_by(name="Public").one_or_none()`
   




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to 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



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org