only delete the person from plc if he/she has site ids. If he/she doesnt it probably...
authorTony Mack <tmack@cs.princeton.edu>
Thu, 3 Sep 2009 17:00:43 +0000 (17:00 +0000)
committerTony Mack <tmack@cs.princeton.edu>
Thu, 3 Sep 2009 17:00:43 +0000 (17:00 +0000)
sfa/methods/remove.py

index c0f5c52..dade3fb 100644 (file)
@@ -42,7 +42,10 @@ class remove(Method):
         
         type = record['type']
         if type == "user":
-            if self.api.plshell.GetPersons(self.api.plauth, record.get_pointer()):
+            persons = self.api.plshell.GetPersons(self.api.plauth, record.get_pointer())
+            # only delete this person if he has site ids. if he doesnt, it probably means 
+            # he was just removed from a site, not actually deleted
+            if persons and persons[0]['site_ids']:
                 self.api.plshell.DeletePerson(self.api.plauth, record.get_pointer())
         elif type == "slice":
             if self.api.plshell.GetSlices(self.api.plauth, record.get_pointer()):