bugfix : fix user_entry validation control (#1871)
* fix user_entry control * code optimsation * poetry syntaxe requirement * poetry is really strict with python * resolve linting error * Update security.py * fix user_entry = [()] Co-authored-by: Hayden <64056131+hay-kot@users.noreply.github.com>
This commit is contained in:
parent
a71067e3ec
commit
25ebe2d6fb
1 changed files with 1 additions and 1 deletions
|
@ -86,7 +86,7 @@ def user_from_ldap(db: AllRepositories, username: str, password: str) -> Private
|
|||
f"(&(objectClass=user)(|(cn={username})(sAMAccountName={username})(mail={username})))",
|
||||
["name", "mail"],
|
||||
)
|
||||
if not user_entry:
|
||||
if user_entry is not None and len(user_entry[0]) != 0 and user_entry[0][0] is not None:
|
||||
user_dn, user_attr = user_entry[0]
|
||||
else:
|
||||
return False
|
||||
|
|
Loading…
Reference in a new issue