VirtualMailManager/Account.py
changeset 43 92a6132940f5
parent 41 fbcb7e314510
child 47 191d5a5adc4a
equal deleted inserted replaced
42:9d10877e1c10 43:92a6132940f5
   220             ERR.INVALID_AGUMENT))
   220             ERR.INVALID_AGUMENT))
   221     if uid < 1:
   221     if uid < 1:
   222         raise VMMAccountException((_('uid must be greater than 0.'),
   222         raise VMMAccountException((_('uid must be greater than 0.'),
   223             ERR.INVALID_AGUMENT))
   223             ERR.INVALID_AGUMENT))
   224     dbc = dbh.cursor()
   224     dbc = dbh.cursor()
   225     dbc.execute("SELECT local_part||'@'||domains.domainname AS address, uid,\
   225     dbc.execute("SELECT local_part||'@'|| domain_name.domainname AS address,\
   226  gid FROM users LEFT JOIN domains USING(gid) WHERE uid=%s", uid)
   226  uid, users.gid FROM users LEFT JOIN domain_name ON (domain_name.gid \
       
   227  = users.gid AND is_primary) WHERE uid = %s;", uid)
   227     info = dbc.fetchone()
   228     info = dbc.fetchone()
   228     dbc.close()
   229     dbc.close()
   229     if info is None:
   230     if info is None:
   230         raise VMMAccountException((_("Account doesn't exists"),
   231         raise VMMAccountException((_("Account doesn't exists"),
   231             ERR.NO_SUCH_ACCOUNT))
   232             ERR.NO_SUCH_ACCOUNT))