You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by GitBox <gi...@apache.org> on 2019/09/15 21:37:18 UTC

[GitHub] [airflow] mik-laj commented on a change in pull request #6109: [AIRFLOW-5490] Fix incorrect None comparison

mik-laj commented on a change in pull request #6109: [AIRFLOW-5490] Fix incorrect None comparison
URL: https://github.com/apache/airflow/pull/6109#discussion_r324482268
 
 

 ##########
 File path: airflow/www/security.py
 ##########
 @@ -340,8 +340,8 @@ def clean_perms(self):
         pvms = (
             sesh.query(sqla_models.PermissionView)
             .filter(or_(
-                sqla_models.PermissionView.permission == None,  # noqa pylint: disable=singleton-comparison
-                sqla_models.PermissionView.view_menu == None,  # noqa pylint: disable=singleton-comparison
+                sqla_models.PermissionView.permission is None,  # noqa pylint: disable=singleton-comparison
 
 Review comment:
   Are you sure? SQL Alchemy behaves differently when comparing types.  This is not used to compare types in Python, but creates a query for SQL Alchemy.

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


With regards,
Apache Git Services