From 113c5ed78fd817fa2d0e297eaf1ece963e8cdbd4 Mon Sep 17 00:00:00 2001 From: Matthew Jones Date: Mon, 2 Nov 2015 12:02:14 -0500 Subject: [PATCH] Clean up authenticate and get_user for ldap auth --- awx/main/backend.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/awx/main/backend.py b/awx/main/backend.py index c8a59350c0..2d2f274cdf 100644 --- a/awx/main/backend.py +++ b/awx/main/backend.py @@ -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)