diff --git a/mitel_ommclient2/client.py b/mitel_ommclient2/client.py index b36bc7b..897ca96 100644 --- a/mitel_ommclient2/client.py +++ b/mitel_ommclient2/client.py @@ -44,9 +44,10 @@ class OMMClient2: :param id: User id """ - r = self.session.request(message.GetAccount(id)) + r = self.session.request(messages.GetAccount(id)) r.raise_on_error() - + if r.account is None: + return None return r.account[0] def ping(self): diff --git a/mitel_ommclient2/messages/getaccount.py b/mitel_ommclient2/messages/getaccount.py index fb0b949..9dc6e6f 100644 --- a/mitel_ommclient2/messages/getaccount.py +++ b/mitel_ommclient2/messages/getaccount.py @@ -24,4 +24,4 @@ class GetAccount(Request): class GetAccountResp(Response): @property def account(self): - return self.attrs.get("account") + return self.childs.get("account")