From: Tony Mack Date: Fri, 5 Jan 2007 16:00:09 +0000 (+0000) Subject: - dont return 'password', 'verification_key' or 'verification_expires' fields X-Git-Tag: pycurl-7_13_1~172 X-Git-Url: http://git.onelab.eu/?a=commitdiff_plain;h=9eceb7226e4b2e7a78bc74c84f9932e0c1256da7;p=plcapi.git - dont return 'password', 'verification_key' or 'verification_expires' fields --- diff --git a/PLC/Methods/GetPersons.py b/PLC/Methods/GetPersons.py index 4de33470..f7b7c5b1 100644 --- a/PLC/Methods/GetPersons.py +++ b/PLC/Methods/GetPersons.py @@ -29,7 +29,8 @@ class GetPersons(Method): ] # Filter out password field - can_return = lambda (field, value): field not in ['password'] + can_return = lambda (field, value): field not in \ + ['password', 'verification_key', 'verification_expires'] return_fields = dict(filter(can_return, Person.fields.items())) returns = [return_fields] @@ -53,9 +54,10 @@ class GetPersons(Method): # Filter out password field if return_fields: - while 'password' in return_fields: - return_fields.remove('password') - + return_fields = filter(self.can_return, return_fields) + else: + return_fields = self.return_fields.keys() + persons = Persons(self.api, person_filter, return_fields) # Filter out accounts that are not viewable