From: Tony Mack Date: Thu, 3 Sep 2009 17:00:43 +0000 (+0000) Subject: only delete the person from plc if he/she has site ids. If he/she doesnt it probably... X-Git-Tag: sfa-0.9-1~25 X-Git-Url: http://git.onelab.eu/?a=commitdiff_plain;h=d653010660d2985b5f638fae56e8c6f9c6c1c5bb;p=sfa.git only delete the person from plc if he/she has site ids. If he/she doesnt it probably means they were just removed form the site but their plc record should not be deleted --- diff --git a/sfa/methods/remove.py b/sfa/methods/remove.py index c0f5c52a..dade3fb8 100644 --- a/sfa/methods/remove.py +++ b/sfa/methods/remove.py @@ -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()):