From 5039ba2626d8b130a610a11b284e1e69bf52ed4d Mon Sep 17 00:00:00 2001 From: Carsten Schabacker Date: Tue, 6 Feb 2024 18:11:54 +0100 Subject: [PATCH] Update find_account, allow search for all properties still not finished --- ActiveCollabAPI/ACAuthenticator.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ActiveCollabAPI/ACAuthenticator.py b/ActiveCollabAPI/ACAuthenticator.py index ed2b2dd..7d6f8d6 100644 --- a/ActiveCollabAPI/ACAuthenticator.py +++ b/ActiveCollabAPI/ACAuthenticator.py @@ -40,8 +40,8 @@ class ACAuthenticator: self.accounts = login_res['accounts'] return login_res - def find_account(self, name): - found = list(filter(lambda a: a['user_display_name'] == name, + def find_account(self, value, field='user_display_name'): + found = list(filter(lambda a: a[field] == value, self.accounts)) if len(found) == 0: raise Exception("Account '%s' not found!" % name)