git://git.onelab.eu
/
plcapi.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
3b2aa95
)
UpdatePerson: fix the part of updating the person HRN tag
author
Mohamed Larabi
<mohamed.larabi@inria.fr>
Fri, 15 Nov 2013 16:39:21 +0000
(17:39 +0100)
committer
Mohamed Larabi
<mohamed.larabi@inria.fr>
Fri, 15 Nov 2013 16:39:21 +0000
(17:39 +0100)
PLC/Methods/UpdatePerson.py
patch
|
blob
|
history
diff --git
a/PLC/Methods/UpdatePerson.py
b/PLC/Methods/UpdatePerson.py
index
1874f13
..
3212ef5
100644
(file)
--- 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:
# 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'])
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'])