fix bug in update_membership_list, oldRecord might be None
authorTony Mack <tmack@cs.princeton.edu>
Tue, 16 Jun 2009 18:04:23 +0000 (18:04 +0000)
committerTony Mack <tmack@cs.princeton.edu>
Tue, 16 Jun 2009 18:04:23 +0000 (18:04 +0000)
geni/util/api.py

index 08e1134..2774f80 100644 (file)
@@ -401,7 +401,10 @@ class GeniAPI:
 
     def update_membership_list(self, oldRecord, record, listName, addFunc, delFunc):
         # get a list of the HRNs tht are members of the old and new records
-        oldList = oldRecord.get(listName, [])
+        if oldRecord:
+            oldList = oldRecord.get(listName, [])
+        else:
+            oldList = []     
         newList = record.get(listName, [])
 
         # if the lists are the same, then we don't have to update anything