Fix BugDir._uuid_cache management for new_bug()/remove_bug().
authorW. Trevor King <wking@drexel.edu>
Wed, 20 Jan 2010 21:25:18 +0000 (16:25 -0500)
committerW. Trevor King <wking@drexel.edu>
Wed, 20 Jan 2010 21:25:18 +0000 (16:25 -0500)
Initial implementation in wking@drexel.edu-20100120192451-j206hn1s78u9a3ys
missed them.

libbe/bugdir.py

index 4711a8f32316324524e3bd922044b5a359db3e94..7e47c33960ddfad753c0960284679b60e7aefccd 100644 (file)
@@ -261,9 +261,13 @@ class BugDir (list, settings_object.SavedSettingsObject):
                      from_storage=False)
         self.append(bg)
         self._bug_map_gen()
+        if hasattr(self, '_uuids_cache') and not bg.uuid in self._uuids_cache:
+            self._uuids_cache.append(bg.uuid)
         return bg
 
     def remove_bug(self, bug):
+        if hasattr(self, '_uuids_cache') and bug.uuid in self._uuids_cache:
+            self._uuids_cache.remove(bug.uuid)
         self.remove(bug)
         if self.storage != None and self.storage.is_writeable():
             bug.remove()