From ed45622c0458bfc484bc20a3cd3b9a631ec555a1 Mon Sep 17 00:00:00 2001 From: kjg Date: Mon, 21 Oct 2024 14:34:58 +0000 Subject: [PATCH] [rt2zammad] update fs2zammad for Task#12785 --- fs2zammad | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/fs2zammad b/fs2zammad index 442df8c..e31ea2a 100755 --- a/fs2zammad +++ b/fs2zammad @@ -104,15 +104,21 @@ def maybe_create_zammad_user(userdata, zammad_session, attr="login", default=Non first = "" kwargs["lastname"] = last kwargs["firstname"] = first + #print("*kwargs",kwargs) #debug try: + #print("*try") #debug user = zammad_session.user.create(kwargs) USERMAP[lowercase_email] = user + #print("*try USERMAP") #debug except: # The use probably exist already... - result = list(zammad.user.search(lowercase_email)) + #print("*ecept") + result = list(zammad.user.search(f'"{lowercase_email}"')) + #print("*ecept result",result) #debug if len(result) >= 1: user = next(u for u in result if u['email'] == lowercase_email) USERMAP[lowercase_email] = user + #print("*except USERMAP",USERMAP) #debug else: print(f"Could not create/fetch user {lowercase_email}")