From: W. Trevor King Date: Wed, 20 Jan 2010 21:25:18 +0000 (-0500) Subject: Fix BugDir._uuid_cache management for new_bug()/remove_bug(). X-Git-Tag: 1.0.0~59^2~46^2~11 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=dc77d9d23ed4707430c33f440ad8edd60b6e24d6;p=be.git Fix BugDir._uuid_cache management for new_bug()/remove_bug(). Initial implementation in wking@drexel.edu-20100120192451-j206hn1s78u9a3ys missed them. --- diff --git a/libbe/bugdir.py b/libbe/bugdir.py index 4711a8f..7e47c33 100644 --- a/libbe/bugdir.py +++ b/libbe/bugdir.py @@ -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()