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
- added logging variable 'object_type'
[plcapi.git]
/
PLC
/
Methods
/
AdmGetSiteTechContacts.py
diff --git
a/PLC/Methods/AdmGetSiteTechContacts.py
b/PLC/Methods/AdmGetSiteTechContacts.py
index
93a9819
..
f531db5
100644
(file)
--- a/
PLC/Methods/AdmGetSiteTechContacts.py
+++ b/
PLC/Methods/AdmGetSiteTechContacts.py
@@
-3,7
+3,7
@@
from PLC.Method import Method
from PLC.Parameter import Parameter, Mixed
from PLC.Sites import Site, Sites
from PLC.Persons import Person, Persons
from PLC.Parameter import Parameter, Mixed
from PLC.Sites import Site, Sites
from PLC.Persons import Person, Persons
-from PLC.Auth import
Password
Auth
+from PLC.Auth import Auth
class AdmGetSiteTechContacts(Method):
"""
class AdmGetSiteTechContacts(Method):
"""
@@
-19,7
+19,7
@@
class AdmGetSiteTechContacts(Method):
roles = ['admin']
accepts = [
roles = ['admin']
accepts = [
-
Password
Auth(),
+ Auth(),
Mixed(Site.fields['site_id'],
Site.fields['login_base'])
]
Mixed(Site.fields['site_id'],
Site.fields['login_base'])
]
@@
-31,13
+31,13
@@
class AdmGetSiteTechContacts(Method):
assert self.caller is not None
# Get site information
assert self.caller is not None
# Get site information
- sites = Sites(self.api, [site_id_or_login_base])
.values()
+ sites = Sites(self.api, [site_id_or_login_base])
if not sites:
raise PLCInvalidArgument, "No such site"
site = sites[0]
if not sites:
raise PLCInvalidArgument, "No such site"
site = sites[0]
- persons = Persons(self.api, site['person_ids'])
.values()
+ persons = Persons(self.api, site['person_ids'])
has_tech_role = lambda person: 'tech' in person['roles']
techs = filter(has_tech_role, persons)
has_tech_role = lambda person: 'tech' in person['roles']
techs = filter(has_tech_role, persons)