add the key string to the person record before passing it to the sfa upcall
authorTony Mack <tmack@cs.princeton.edu>
Thu, 10 Sep 2009 22:23:43 +0000 (22:23 +0000)
committerTony Mack <tmack@cs.princeton.edu>
Thu, 10 Sep 2009 22:23:43 +0000 (22:23 +0000)
PLC/Methods/AddPersonKey.py

index 79cdfc6..c7a8d24 100644 (file)
@@ -44,7 +44,7 @@ class AddPersonKey(Method):
         if person['peer_id'] is not None:
             raise PLCInvalidArgument, "Not a local account"
 
-       # If we are not admin, make sure caller is adding a key to their account
+        # If we are not admin, make sure caller is adding a key to their account
         if 'admin' not in self.caller['roles']:
             if person['person_id'] != self.caller['person_id']:
                 raise PLCPermissionDenied, "You may only modify your own keys"
@@ -60,6 +60,7 @@ class AddPersonKey(Method):
                         (key['key_id'], person['person_id'])
 
         # sync with the geni db
+        person['key'] = key_fields['key']
         sfa = SFA(self.api)
         sfa.update_record(person, 'user')