equal
deleted
inserted
replaced
477 raise AErr(_(u'UID must be an int/long.'), INVALID_ARGUMENT) |
477 raise AErr(_(u'UID must be an int/long.'), INVALID_ARGUMENT) |
478 if uid < 1: |
478 if uid < 1: |
479 raise AErr(_(u'UID must be greater than 0.'), INVALID_ARGUMENT) |
479 raise AErr(_(u'UID must be greater than 0.'), INVALID_ARGUMENT) |
480 dbc = dbh.cursor() |
480 dbc = dbh.cursor() |
481 dbc.execute("SELECT local_part||'@'|| domain_name.domainname AS address, " |
481 dbc.execute("SELECT local_part||'@'|| domain_name.domainname AS address, " |
482 "uid, users.gid FROM users LEFT JOIN domain_name ON " |
482 "uid, users.gid, note FROM users LEFT JOIN domain_name ON " |
483 "(domain_name.gid = users.gid AND is_primary) WHERE uid = %s", |
483 "(domain_name.gid = users.gid AND is_primary) WHERE uid = %s", |
484 (uid,)) |
484 (uid,)) |
485 info = dbc.fetchone() |
485 info = dbc.fetchone() |
486 dbc.close() |
486 dbc.close() |
487 if not info: |
487 if not info: |
488 raise AErr(_(u"There is no account with the UID: '%d'") % uid, |
488 raise AErr(_(u"There is no account with the UID: '%d'") % uid, |
489 NO_SUCH_ACCOUNT) |
489 NO_SUCH_ACCOUNT) |
490 info = dict(zip(('address', 'uid', 'gid'), info)) |
490 info = dict(zip(('address', 'uid', 'gid', 'note'), info)) |
491 return info |
491 return info |
492 |
492 |
493 del _, cfg_dget |
493 del _, cfg_dget |