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 2018/12/28 04:42:54 UTC

[GitHub] stale[bot] closed pull request #4132: [AIRFLOW-3298] Return None if user not found in session.

stale[bot] closed pull request #4132: [AIRFLOW-3298] Return None if user not found in session.
URL: https://github.com/apache/incubator-airflow/pull/4132
 
 
   

This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:

As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):

diff --git a/airflow/contrib/auth/backends/ldap_auth.py b/airflow/contrib/auth/backends/ldap_auth.py
index fefc389e48..65a5a6b5ec 100644
--- a/airflow/contrib/auth/backends/ldap_auth.py
+++ b/airflow/contrib/auth/backends/ldap_auth.py
@@ -271,6 +271,9 @@ def load_user(userid, session=None):
         return None
 
     user = session.query(models.User).filter(models.User.id == int(userid)).first()
+    if not user:
+        return None
+
     return LdapUser(user)
 
 


 

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services