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 2022/07/09 21:52:36 UTC

[GitHub] [superset] john-bodley commented on a diff in pull request #20492: refactor: Cleanup user get_id/get_user_id

john-bodley commented on code in PR #20492:
URL: https://github.com/apache/superset/pull/20492#discussion_r906222351


##########
superset/dashboards/filters.py:
##########
@@ -57,9 +58,9 @@ def apply(self, query: Query, value: Any) -> Query:
         return query.filter(
             or_(
                 Dashboard.created_by_fk  # pylint: disable=comparison-with-callable
-                == g.user.get_user_id(),

Review Comment:
   The [get_user_id](https://github.com/dpgaspar/Flask-AppBuilder/blob/090ddb4645992fb390da93906301c63b204db0df/flask_appbuilder/security/sqla/models.py#L141-L146) method is a classmethod and thus doesn't return the ID associated with the `user` object but rather the `g.user.id`. In this case they're the same but it's very misleading.



-- 
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.

To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org

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