From 20d2fdecbb5bf1412bc8ba99f7f31bd1926d4d8e Mon Sep 17 00:00:00 2001 From: Thierry Parmentelat Date: Tue, 2 Jun 2015 14:19:44 +0200 Subject: [PATCH] this belongs with previous change on authority's name this is how sfi update now does the right thing with both users and authority wrt email and name --- sfa/managers/registry_manager.py | 24 +++++++++++++++++------- 1 file changed, 17 insertions(+), 7 deletions(-) diff --git a/sfa/managers/registry_manager.py b/sfa/managers/registry_manager.py index a65832f9..f17b3161 100644 --- a/sfa/managers/registry_manager.py +++ b/sfa/managers/registry_manager.py @@ -467,13 +467,23 @@ class RegistryManager: # not too big a deal with planetlab as the driver is authoritative, but... # update native relations - if isinstance (record, RegSlice): - researcher_hrns = getattr(new_record,'reg-researchers',None) - if researcher_hrns is not None: record.update_researchers (researcher_hrns, dbsession) - - elif isinstance (record, RegAuthority): - pi_hrns = getattr(new_record,'reg-pis',None) - if pi_hrns is not None: record.update_pis (pi_hrns, dbsession) + if isinstance(record, RegSlice): + researcher_hrns = getattr(new_record, 'reg-researchers', None) + if researcher_hrns is not None: + record.update_researchers (researcher_hrns, dbsession) + + elif isinstance(record, RegAuthority): + pi_hrns = getattr(new_record, 'reg-pis', None) + if pi_hrns is not None: + record.update_pis(pi_hrns, dbsession) + name = getattr(new_record, 'name', None) + if name is not None: + record.name = name + + elif isinstance(record, RegUser): + email = getattr(new_record, 'email', None) + if email is not None: + record.email = email # update the PLC information that was specified with the record # xxx oddly enough, without this useless statement, -- 2.43.0