- make sure to handle anon callers correctly
authorTony Mack <tmack@cs.princeton.edu>
Mon, 16 Jul 2007 20:00:09 +0000 (20:00 +0000)
committerTony Mack <tmack@cs.princeton.edu>
Mon, 16 Jul 2007 20:00:09 +0000 (20:00 +0000)
PLC/Methods/GetNodes.py

index 39dff8b..b0e8c0f 100644 (file)
@@ -37,7 +37,9 @@ class GetNodes(Method):
         # Remove admin only fields
         if not isinstance(self.caller, Person) or \
            'admin' not in self.caller['roles']:
-           slice_ids = set(self.caller['slice_ids'])
+           slice_ids = set()
+           if self.caller:
+               slice_ids.update(self.caller['slice_ids'])
             for node in nodes:
                # if node has whitelist, make sure the user has a slice on the whitelist 
                if 'slice_ids_whitelist' in node and \