- no longer filter out None
authorTony Mack <tmack@cs.princeton.edu>
Fri, 13 Oct 2006 15:33:02 +0000 (15:33 +0000)
committerTony Mack <tmack@cs.princeton.edu>
Fri, 13 Oct 2006 15:33:02 +0000 (15:33 +0000)
PLC/Methods/GetNodeNetworks.py
PLC/Methods/GetPersons.py

index 14cdd48..199f9bd 100644 (file)
@@ -33,14 +33,11 @@ class GetNodeNetworks(Method):
 
        # Get node networks for this node
         if node['nodenetwork_ids']:
-            nodenetworks = NodeNetworks(self.api, node['nodenetwork_ids']).values()
+               nodenetworks = NodeNetworks(self.api, node['nodenetwork_ids']).values()
         else:
-            nodenetworks = []
+               nodenetworks = []
 
-       # Filter out undesired or None fields (XML-RPC cannot marshal
-        # None) and turn each node into a real dict.
-        valid_return_fields_only = lambda (key, value): value is not None
-        nodenetworks = [dict(filter(valid_return_fields_only, nodenetwork.items())) \
-                        for nodenetwork in nodenetworks]
+       # Turn each node into a real dict.
+        nodenetworks = [dict(nodenetwork.items()) for nodenetwork in nodenetworks]
                
        return nodenetworks
index 3805adc..1e3fa3b 100644 (file)
@@ -61,11 +61,7 @@ class GetPersons(Method):
         # Filter out accounts that are not viewable and turn into list
         persons = filter(self.caller.can_view, persons.values())
 
-        # Filter out undesired or None fields (XML-RPC cannot marshal
-        # None) and turn each person into a real dict.
-        valid_return_fields_only = lambda (key, value): \
-                                   key in return_fields and value is not None
-        persons = [dict(filter(valid_return_fields_only, person.items())) \
-                   for person in persons]
+        # Turn each person into a real dict.
+        persons = [dict(person.items()) for person in persons]
                     
         return persons