From 10206b34a0f3ba93f87ddfd17ac66bb96e9eac13 Mon Sep 17 00:00:00 2001 From: Raphael Ackermann Date: Sun, 4 Apr 2010 11:07:29 +0000 Subject: [PATCH] 0002953: wrong handling of gramps id's on individual report. I44 and I440 I441 etc are all included when only I44 should be replacing comparison by find with == (find only looks for substrings, doesn't check for equality of strings) svn: r15023 --- 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]