More informative error message when LDAP messes up
This commit is contained in:
parent
744f12dccf
commit
1fc2a04040
1 changed files with 3 additions and 0 deletions
|
@ -36,7 +36,10 @@ def fetch_cas_account(cas_login):
|
|||
if not res:
|
||||
return None
|
||||
|
||||
if len(res) != 1:
|
||||
raise RuntimeError("LDAP returned too many results: {}".format(res))
|
||||
(res,) = res
|
||||
|
||||
assert _extract_ldap_info(res, "uid") == cas_login
|
||||
return {
|
||||
"cn": _extract_ldap_info(res, "cn"),
|
||||
|
|
Loading…
Reference in a new issue