commit a9a46c99097f02d16c4a4425c40dbd5181bed996 Author: Pierre-Yves Chibon pingou@pingoured.fr Date: Mon Nov 24 11:22:28 2014 +0100
Adjust __get_fas_user_by_email
We might have situations where the email address does not correspond to an user in FAS, we should be able to handle such situation.
pkgdb2client/utils.py | 8 ++++++-- 1 files changed, 6 insertions(+), 2 deletions(-) --- diff --git a/pkgdb2client/utils.py b/pkgdb2client/utils.py index be7352e..9947796 100644 --- a/pkgdb2client/utils.py +++ b/pkgdb2client/utils.py @@ -110,9 +110,13 @@ def __get_fas_user_by_email(email_address): userid = FASCLIENT.people_query( constraints={'email': email_address}, columns=['id'] - )[0].id + ) + if userid: + userid = userid[0].id
- user = FASCLIENT.person_by_id(userid) + user = None + if userid: + user = FASCLIENT.person_by_id(userid)
return user
packagedb-cli-commits@lists.stg.fedorahosted.org