From: Tony Mack Date: Thu, 1 Dec 2011 21:22:37 +0000 (-0500) Subject: fix bug in verify_persons X-Git-Tag: sfa-2.0-2~23 X-Git-Url: http://git.onelab.eu/?a=commitdiff_plain;ds=sidebyside;h=dfa8f8b9755235b7078289c27264c81c111e8331;p=sfa.git fix bug in verify_persons --- diff --git a/sfa/plc/slices.py b/sfa/plc/slices.py index 582dd67c..d694a6f1 100644 --- a/sfa/plc/slices.py +++ b/sfa/plc/slices.py @@ -390,13 +390,14 @@ class Slices: user_found = False for existing_user in existing_site_persons_list: for site_id in existing_user['site_ids']: - site = sites[site_id] - if login_base == site['login_base'] and \ - existing_user['email'].startswith(requested_user['username']): - existing_user_ids.append(existing_user['email']) - users_dict[existing_user['email']] = requested_user - user_found = True - break + if site_id in sites: + site = sites[site_id] + if login_base == site['login_base'] and \ + existing_user['email'].startswith(requested_user['username']): + existing_user_ids.append(existing_user['email']) + users_dict[existing_user['email']] = requested_user + user_found = True + break if user_found: break