git://git.onelab.eu
/
plcapi.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
- add peer to roles
[plcapi.git]
/
PLC
/
Methods
/
SetPersonPrimarySite.py
diff --git
a/PLC/Methods/SetPersonPrimarySite.py
b/PLC/Methods/SetPersonPrimarySite.py
index
1f7cd39
..
e2e913f
100644
(file)
--- a/
PLC/Methods/SetPersonPrimarySite.py
+++ b/
PLC/Methods/SetPersonPrimarySite.py
@@
-31,7
+31,8
@@
class SetPersonPrimarySite(Method):
if not persons:
raise PLCInvalidArgument, "No such account"
if not persons:
raise PLCInvalidArgument, "No such account"
- person = persons.values()[0]
+ person = persons[0]
+ PLCCheckLocalPerson(person,"SetPersonPrimarySite")
# Authenticated function
assert self.caller is not None
# Authenticated function
assert self.caller is not None
@@
-46,7
+47,8
@@
class SetPersonPrimarySite(Method):
if not sites:
raise PLCInvalidArgument, "No such site"
if not sites:
raise PLCInvalidArgument, "No such site"
- site = sites.values()[0]
+ site = sites[0]
+ PLCCheckLocalSite(site,"SetPersonPrimarySite")
if site['site_id'] not in person['site_ids']:
raise PLCInvalidArgument, "Not a member of the specified site"
if site['site_id'] not in person['site_ids']:
raise PLCInvalidArgument, "Not a member of the specified site"