1
0
mirror of https://github.com/ansible/awx.git synced 2024-11-01 08:21:15 +03:00

Clean up authenticate and get_user for ldap auth

This commit is contained in:
Matthew Jones 2015-11-02 12:02:14 -05:00
parent dd29bc40d9
commit 113c5ed78f

View File

@ -52,13 +52,16 @@ class LDAPBackend(BaseLDAPBackend):
def authenticate(self, username, password):
if not self.settings.SERVER_URI:
return None
if self.settings.SERVER_URI and not feature_enabled('ldap'):
if not feature_enabled('ldap'):
logger.error("LDAP authenticate failed for missing license feature")
return None
return super(LDAPBackend, self).authenticate(username, password)
def get_user(self, user_id):
if not self.settings.SERVER_URI or not feature_enabled('ldap'):
if not self.settings.SERVER_URI:
return None
if not feature_enabled('ldap'):
logger.error("LDAP get_user failed for missing license feature")
return None
return super(LDAPBackend, self).get_user(user_id)