# HG changeset patch # User Pascal Volk # Date 1271373924 0 # Node ID af555e6967c8a316e1aec48ab5d5f6a11f2dd138 # Parent 0963ad2f5fe28e793ed8689bf651af1a6ff926a3 VMM/Account: renamed function getAccountByID -> get_account_by_uid. Fixed AttributeError (tid) in Account._prepare(). Removed unused imports. diff -r 0963ad2f5fe2 -r af555e6967c8 VirtualMailManager/Account.py --- a/VirtualMailManager/Account.py Thu Apr 15 22:04:33 2010 +0000 +++ b/VirtualMailManager/Account.py Thu Apr 15 23:25:24 2010 +0000 @@ -12,8 +12,8 @@ from VirtualMailManager.EmailAddress import EmailAddress from VirtualMailManager.Transport import Transport from VirtualMailManager.constants.ERROR import \ - ACCOUNT_EXISTS, ACCOUNT_MISSING_PASSWORD, ALIAS_EXISTS, ALIAS_PRESENT, \ - INVALID_AGUMENT, NO_SUCH_ACCOUNT, NO_SUCH_DOMAIN, RELOCATED_EXISTS, \ + ACCOUNT_EXISTS, ACCOUNT_MISSING_PASSWORD, ALIAS_PRESENT, \ + INVALID_AGUMENT, NO_SUCH_ACCOUNT, NO_SUCH_DOMAIN, \ UNKNOWN_MAILLOCATION_NAME, UNKNOWN_SERVICE from VirtualMailManager.errors import AccountError as AErr from VirtualMailManager.maillocation import MailLocation, known_format @@ -85,7 +85,7 @@ maillocation, UNKNOWN_MAILLOCATION_NAME) self._mid = MailLocation(format=maillocation).mid if not self._tid: - self._tid = self._domain.tid + self._tid = self._domain.transport.tid self._set_uid() def _switch_state(self, state, dcvers, service): @@ -372,9 +372,12 @@ dbc.close() -def getAccountByID(uid, dbh): +def get_account_by_uid(uid, dbh): """Search an Account by its UID. + This function returns a dict (keys: 'address', 'gid' and 'uid'), if an + Account with the given *uid* exists. + Argument: `uid` : long