From: Scott Baker Date: Tue, 4 Nov 2008 19:22:52 +0000 (+0000) Subject: fix problem when updating persons X-Git-Tag: sfa-0.9-0@14641~814 X-Git-Url: http://git.onelab.eu/?a=commitdiff_plain;h=9a030a6feffe5ad2502c62a9597cd254e6f2a80a;hp=0f4de8620cfc5eca6fe33ba19934081b0375b6f2;p=sfa.git fix problem when updating persons --- diff --git a/plc/plc.py b/plc/plc.py index b5e67d37..e9457b71 100644 --- a/plc/plc.py +++ b/plc/plc.py @@ -241,6 +241,7 @@ class Registry(GeniServer): # for example, the top level authority records which are # authorities, but not PL "sites" if pointer == -1: + record.set_pl_info({}) return if (type == "sa") or (type == "ma"): @@ -541,7 +542,17 @@ class Registry(GeniServer): self.shell.UpdateSlice(self.pl_auth, pointer, record.get_pl_info()) elif type == "user": - self.shell.UpdatePerson(self.pl_auth, pointer, record.get_pl_info()) + # SMBAKER: UpdatePerson only allows a limited set of fields to be + # updated. Ideally we should have a more generic way of doing + # this. I copied the field names from UpdatePerson.py... + update_fields = {} + all_fields = record.get_pl_info() + for key in all_fields.keys(): + if key in ['first_name', 'last_name', 'title', 'email', + 'password', 'phone', 'url', 'bio', 'accepted_aup', + 'enabled']: + update_fields[key] = all_fields[key] + self.shell.UpdatePerson(self.pl_auth, pointer, update_fields) elif type == "node": self.shell.UpdateNode(self.pl_auth, pointer, record.get_pl_info())