From 83b9feb8363bcea28c992bedd63b486f03f86b77 Mon Sep 17 00:00:00 2001 From: Brian Matherly Date: Sat, 21 Apr 2007 18:48:04 +0000 Subject: [PATCH] 0000970: _IsBookmarked.py causes crash svn: r8415 --- gramps2/ChangeLog | 4 ++++ gramps2/src/Filters/Rules/Person/_IsBookmarked.py | 10 +++------- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/gramps2/ChangeLog b/gramps2/ChangeLog index ecf2d0f39..11d61ce27 100644 --- a/gramps2/ChangeLog +++ b/gramps2/ChangeLog @@ -1,3 +1,7 @@ +2007-04-21 Brian Matherly + * src/Filters/Rules/Person/_IsBookmarked.py: + 0000970: _IsBookmarked.py causes crash + 2007-04-20 Don Allingham * src/GrampsDb/_ReadGedcom.py: fix calendar parsing * src/GrampsDb/_WriteGedcom.py: fix calendar generation diff --git a/gramps2/src/Filters/Rules/Person/_IsBookmarked.py b/gramps2/src/Filters/Rules/Person/_IsBookmarked.py index 8a9ec86b7..e21b9ff81 100644 --- a/gramps2/src/Filters/Rules/Person/_IsBookmarked.py +++ b/gramps2/src/Filters/Rules/Person/_IsBookmarked.py @@ -2,6 +2,7 @@ # Gramps - a GTK+/GNOME based genealogy program # # Copyright (C) 2002-2006 Donald N. Allingham +# Copyright (C) 2007 Brian Matherly # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -52,12 +53,7 @@ class IsBookmarked(Rule): description = _("Matches the people on the bookmark list") def prepare(self,db): - bookmarks = db.get_bookmarks() - if len(bookmarks) == 0: - self.apply = lambda db,p : False - else: - self.bookmarks = set(bookmarks) - self.apply = self.apply_real + self.bookmarks = db.get_bookmarks().get() - def apply_real(self,db,person): + def apply(self,db,person): return person.handle in self.bookmarks