Update find_account, allow search for all properties

still not finished
This commit is contained in:
2024-02-06 18:11:54 +01:00
parent deafc497e6
commit 5039ba2626
+2 -2
View File
@@ -40,8 +40,8 @@ class ACAuthenticator:
self.accounts = login_res['accounts'] self.accounts = login_res['accounts']
return login_res return login_res
def find_account(self, name): def find_account(self, value, field='user_display_name'):
found = list(filter(lambda a: a['user_display_name'] == name, found = list(filter(lambda a: a[field] == value,
self.accounts)) self.accounts))
if len(found) == 0: if len(found) == 0:
raise Exception("Account '%s' not found!" % name) raise Exception("Account '%s' not found!" % name)