From a2cc651251b47ee6d8c16d114ad18f4ca99eabdc Mon Sep 17 00:00:00 2001 From: Mohamed Larabi Date: Fri, 15 Nov 2013 17:39:21 +0100 Subject: [PATCH] UpdatePerson: fix the part of updating the person HRN tag --- PLC/Methods/UpdatePerson.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/PLC/Methods/UpdatePerson.py b/PLC/Methods/UpdatePerson.py index 1874f13..3212ef5 100644 --- a/PLC/Methods/UpdatePerson.py +++ b/PLC/Methods/UpdatePerson.py @@ -88,8 +88,9 @@ class UpdatePerson(Method): # if email was modifed make sure to update the hrn tag if 'email' in native: - old_hrn=PersonTags(self.api,{'tagname':'hrn','person_id':person['person_id']})[0]['value'] - if old_hrn : + hrn_tag=PersonTags(self.api,{'tagname':'hrn','person_id':person['person_id']}) + if hrn_tag: + old_hrn = hrn_tag[0]['value'] root_auth = self.api.config.PLC_HRN_ROOT login_base = old_hrn.split('.')[-2] hrn=email_to_hrn("%s.%s"%(root_auth,login_base),person['email']) -- 2.43.0