ashb commented on a change in pull request #4276: [AIRFLOW-1552] Airflow 
Filter_by_owner not working with password_auth
URL: https://github.com/apache/incubator-airflow/pull/4276#discussion_r238710034
 
 

 ##########
 File path: airflow/contrib/auth/backends/password_auth.py
 ##########
 @@ -106,8 +102,8 @@ def load_user(userid, session=None):
     if not userid or userid == 'None':
         return None
 
-    user = session.query(models.User).filter(models.User.id == 
int(userid)).first()
-    return PasswordUser(user)
+    user = session.query(PasswordUser).filter(PasswordUser.id == 
int(userid)).first()
 
 Review comment:
   I suspect this will fail tests as 
https://github.com/apache/incubator-airflow/blob/b7a7fd66d693dbfbc471a6d08bc274441ee4841c/airflow/www/utils.py#L299
 won't work anymore.
   
   And this (admittedly silly) API is part of the external API that people have 
written custom auth backends against so we can't change it. If we were keeping 
these I'd say it's worth "fixing" this (as you have here) but since we're 
removing the custom auth backends in Favour of Flask-AppBuilder in 2.0.0 it's 
probably worth just keeping the sillyness.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to