瀏覽代碼

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

Jon Natkins 13 年之前
父節點
當前提交
39b289bd92
共有 1 個文件被更改,包括 3 次插入0 次删除
  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)