From 140ce8077d5c61fe026bacfd7a210564dfe89578 Mon Sep 17 00:00:00 2001 From: Benny Malengier Date: Thu, 2 Sep 2010 21:03:53 +0000 Subject: [PATCH] 2953: wrong handling of gramps id's on individual report. I44 and I440 I441 etc are all included when only I44 should be svn: r15850 --- src/Filters/Rules/_HasGrampsId.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/Filters/Rules/_HasGrampsId.py b/src/Filters/Rules/_HasGrampsId.py index 78ea95e30..7eed1ed3c 100644 --- a/src/Filters/Rules/_HasGrampsId.py +++ b/src/Filters/Rules/_HasGrampsId.py @@ -2,6 +2,7 @@ # Gramps - a GTK+/GNOME based genealogy program # # Copyright (C) 2002-2006 Donald N. Allingham +# Copyright (C) 2010 Raphael Ackermann # # 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 @@ -40,7 +41,7 @@ from Filters.Rules import Rule # #------------------------------------------------------------------------- class HasGrampsId(Rule): - """Rule that checks for a person with a specific GRAMPS ID.""" + """Rule that checks for an object with a specific GRAMPS ID.""" labels = [ _('ID:') ] name = _('Object with ') @@ -48,4 +49,8 @@ class HasGrampsId(Rule): category = _('General filters') def apply(self, db, obj): - return obj.gramps_id.find(self.list[0]) !=-1 + """ + apply the rule on the obj. + return true if the rule passes, false otherwise. + """ + return obj.gramps_id == self.list[0]