[fs2zammad] add exact filter on looked up user emails
This commit is contained in:
parent
29431f72df
commit
5ca451510f
1 changed files with 2 additions and 2 deletions
|
@ -91,8 +91,8 @@ def maybe_create_zammad_user(userdata, zammad_session, attr="login", default=Non
|
|||
except:
|
||||
# The use probably exist already...
|
||||
result = list(zammad.user.search(lowercase_email))
|
||||
if len(result) == 1:
|
||||
user = list.pop(result)
|
||||
if len(result) >= 1:
|
||||
user = next(u for u in result if u.email == lowercase_email)
|
||||
USERMAP[lowercase_email] = user
|
||||
else:
|
||||
print(f"Could not create/fetch user {lowercase_email}")
|
||||
|
|
Loading…
Reference in a new issue