After adding the record to the plc db, check if the record exists in sfa db. sfa...
authorTony Mack <tmack@cs.princeton.edu>
Mon, 10 Aug 2009 18:19:42 +0000 (18:19 +0000)
committerTony Mack <tmack@cs.princeton.edu>
Mon, 10 Aug 2009 18:19:42 +0000 (18:19 +0000)
sfa/methods/register.py

index ef4f186..00ec075 100644 (file)
@@ -119,7 +119,11 @@ class register(Method):
         else:
             raise UnknownGeniType(type)
 
-        table.insert(record)
+        # SFA upcalls may exist in PLCAPI and they could have already added the
+        # record for us. Lets check if the record already exists  
+        existing_records = table.resolve(type, name)
+        if not existing_records:
+            table.insert(record)
 
         # update membership for researchers, pis, owners, operators
         self.api.update_membership(None, record)