Browse Source

Add a bit of error checking when setting up an LDAP connection

Jon Natkins 13 years ago
parent
commit
39b289bd92
1 changed files with 3 additions and 0 deletions
  1. 3 0
      apps/useradmin/src/useradmin/ldap_access.py

+ 3 - 0
apps/useradmin/src/useradmin/ldap_access.py

@@ -38,6 +38,9 @@ def get_connection():
   password = desktop.conf.LDAP.BIND_PASSWORD.get()
   ldap_cert = desktop.conf.LDAP.LDAP_CERT.get()
 
+  if ldap_url is None:
+    raise Exception('No LDAP URL was specified')
+
   return LdapConnection(ldap_url, get_ldap_username(username, nt_domain),
                         password, ldap_cert)