From 25ebe2d6fb674b840f0710bbc1328aebfd10fc56 Mon Sep 17 00:00:00 2001 From: tomamplius Date: Sun, 1 Jan 2023 21:52:49 +0100 Subject: [PATCH] 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> --- mealie/core/security/security.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mealie/core/security/security.py b/mealie/core/security/security.py index 206241ae59fe..b0871b82addd 100644 --- a/mealie/core/security/security.py +++ b/mealie/core/security/security.py @@ -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