From f910ee2ea4e1213bf3fe8d60536be93aac87e118 Mon Sep 17 00:00:00 2001 From: npze Date: Wed, 24 Jul 2013 10:02:42 +0200 Subject: [PATCH] Fix user mail bug in user list function --- yunohost_user.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/yunohost_user.py b/yunohost_user.py index f683c33c..3005caf8 100644 --- a/yunohost_user.py +++ b/yunohost_user.py @@ -72,10 +72,11 @@ def user_list(fields=None, filter=None, limit=None, offset=None): entry = { 'Username': user['uid'][0], 'Fullname': user['cn'][0], - 'Mail': user['mail'][0] } - if len(user['mail']) > 1: - entry['Mail Aliases'] = user['mail'][1:] + if 'mail' in user.keys(): + entry['Mail'] = user['mail'][0] + if len(user['mail']) > 1: + entry['Mail Aliases'] = user['mail'][1:] if 'maildrop' in user: entry['Mail Forward'] = user['maildrop']