diff --git a/ActiveCollabAPI/ACAuthenticator.py b/ActiveCollabAPI/ACAuthenticator.py index 9882667..ed2b2dd 100644 --- a/ActiveCollabAPI/ACAuthenticator.py +++ b/ActiveCollabAPI/ACAuthenticator.py @@ -41,5 +41,8 @@ class ACAuthenticator: return login_res def find_account(self, name): - # FIXME: implement search - return self.accounts[0] + found = list(filter(lambda a: a['user_display_name'] == name, + self.accounts)) + if len(found) == 0: + raise Exception("Account '%s' not found!" % name) + return found[0] diff --git a/config-example.ini b/config-example.ini index 93306e6..b986327 100644 --- a/config-example.ini +++ b/config-example.ini @@ -2,4 +2,4 @@ [LOGIN] username = you@example.com password = very-secret -account_name = "#123456" \ No newline at end of file +account_name = #123456 \ No newline at end of file